- Remove act_runner binary (download on install) - Remove .runner (auto-generated credentials) - Remove data/ directory (root-owned temp) - Remove docker-compose.yml (not needed for systemd setup) - Update README with systemd installation steps - Update register.sh to download binary + systemd workflow - Update gitea-runner.service with PATH env var - Add comprehensive .gitignore for terraform/ansible/runners/secrets
2.9 KiB
2.9 KiB
Gitea Actions Runner — Hestia
Este diretório contém a configuração do runner de Gitea Actions para executar workflows CI/CD.
Visão Geral
O act_runner é o agente que executa os jobs definidos nos workflows .gitea/workflows/*.yml. Ele roda no Hestia (10.0.0.50) como serviço systemd.
Arquivos
gitea-runner/
├── config.yaml # Configuração do runner
├── gitea-runner.service # Serviço systemd
├── register.sh # Script de registro
└── README.md # Este arquivo
Pré-requisitos
- Docker instalado e acessível ao usuário
- Usuário
iamferreirajpno grupodocker - Node.js em
$HOME/.local/bin(path do Hermes)
Instalação
1. Download do act_runner
cd gitea-runner
curl -L https://codeberg.org/pressman/act_runner/releases/latest/download/act_runner-linux-amd64 -o act_runner
chmod +x act_runner
2. Obter Token de Registro
Acesse o Gitea como admin:
https://gitea.hackerfortress.cc/gaia/homelab/settings/actions/runners
Clique em "Create new Runner", configure o nome e copie o token.
3. Registrar o Runner
cd ~/homelab/gitea-runner
export RUNNER_TOKEN="<token_copiado>"
./register.sh
O register.sh vai:
- Baixar o act_runner (se não existir)
- Registrar no Gitea
- Gerar
config.yamle.runner
4. Instalar o Serviço systemd
sudo cp gitea-runner.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable --now gitea-runner
5. Verificar
sudo systemctl status gitea-runner
Acesse:
https://gitea.hackerfortress.cc/gaia/homelab/settings/actions/runners
O runner deve aparecer como "Idle".
Configuração
O config.yaml controla:
- Labels disponíveis (
ubuntu-latest, etc.) - Capacidade de jobs paralelos
- Docker host (unix socket)
O PATH do serviço systemd inclui:
/home/iamferreirajp/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
Troubleshooting
Runner não aparece como idle
# Ver logs
journalctl -u gitea-runner -f --no-pager
# Verificar configuração
cat config.yaml
Docker socket permission denied
# Adicionar usuário ao grupo docker
sudo usermod -aG docker iamferreirajp
# Faça logout e login novamente
Jobs falham com "Cannot find: node in PATH"
O PATH do systemd precisa incluir ~/.local/bin. Verifique se o gitea-runner.service tem:
Environment=PATH=/home/iamferreirajp/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
Jobs ficam em "Waiting"
Verificar se o runner está online no Gitea e se o workflow pede labels que o runner tem.
Atualização
cd ~/homelab/gitea-runner
# Baixar nova versão
curl -L https://codeberg.org/pressman/act_runner/releases/latest/download/act_runner-linux-amd64 -o act_runner
chmod +x act_runner
# Reiniciar
sudo systemctl restart gitea-runner