feat(gitea-runner): add systemd service file + binary download (no secrets)
This commit is contained in:
parent
cc88ad5c05
commit
dc436b3518
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
.runner
|
||||
token.txt
|
||||
BIN
gitea-runner/act_runner
Executable file
BIN
gitea-runner/act_runner
Executable file
Binary file not shown.
@ -8,7 +8,6 @@ runner:
|
||||
labels:
|
||||
- gitea-runner-hestia
|
||||
- ubuntu-latest:docker://ubuntu:latest
|
||||
- ubuntu-latest:host
|
||||
|
||||
cache:
|
||||
enabled: false
|
||||
|
||||
14
gitea-runner/gitea-runner.service
Normal file
14
gitea-runner/gitea-runner.service
Normal file
@ -0,0 +1,14 @@
|
||||
[Unit]
|
||||
Description=Gitea Actions Runner
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=iamferreirajp
|
||||
WorkingDirectory=/home/iamferreirajp/homelab/gitea-runner
|
||||
ExecStart=/home/iamferreirajp/homelab/gitea-runner/act_runner daemon
|
||||
Restart=always
|
||||
RestartSec=5
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@ -9,7 +9,7 @@
|
||||
set -e
|
||||
|
||||
GITEA_URL="${INSTANCE_URL:-https://gitea.hackerfortress.cc}"
|
||||
TOKEN="eBtqNTibRTIrZxlcqopYJUeJJj1mhaCJxIaEOhcU"
|
||||
TOKEN="${RUNNER_TOKEN}"
|
||||
|
||||
if [ -z "$TOKEN" ]; then
|
||||
echo "❌ RUNNER_TOKEN not set"
|
||||
@ -19,41 +19,16 @@ fi
|
||||
|
||||
echo "📡 Registering runner with Gitea at ${GITEA_URL}..."
|
||||
|
||||
# Create initial config for registration
|
||||
cat > config.yaml << EOF
|
||||
log:
|
||||
level: info
|
||||
formatting: text
|
||||
|
||||
runner:
|
||||
capacity: 2
|
||||
name: gitea-runner-hestia
|
||||
labels:
|
||||
- gitea-runner-hestia
|
||||
- ubuntu-latest:docker://ubuntu:latest
|
||||
- ubuntu-latest:host
|
||||
|
||||
cache:
|
||||
enabled: false
|
||||
|
||||
docker:
|
||||
host: unix:///var/run/docker.sock
|
||||
network: ""
|
||||
privileged: false
|
||||
EOF
|
||||
|
||||
# Run registration using the runner itself
|
||||
docker compose run --rm \
|
||||
-e GITEA_INSTANCE_URL="${GITEA_URL}" \
|
||||
-e GITEA_RUNNER_TOKEN="${TOKEN}" \
|
||||
act_runner \
|
||||
act_runner register \
|
||||
# Register and get the runner config
|
||||
docker compose run --rm act_runner \
|
||||
act_runner generate-config \
|
||||
--instance "${GITEA_URL}" \
|
||||
--token "${TOKEN}" \
|
||||
--name "gitea-runner-hestia" \
|
||||
--labels "gitea-runner-hestia"
|
||||
--name "gitea-runner-dockerino" \
|
||||
> config.yaml
|
||||
|
||||
echo "✅ Runner registered successfully!"
|
||||
echo ""
|
||||
echo "Now start with:"
|
||||
echo " docker compose up -d"
|
||||
echo "Next steps:"
|
||||
echo "1. Review config.yaml"
|
||||
echo "2. Run: docker compose up -d"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user