Install gitea-runner on a VM as a systemd service

One hosts/<host>.env per runner (name, user, labels, capacity) and an
idempotent install.sh: pinned VERSION with sha256 check, minimal
config.yaml and .runner in /var/lib/gitea-runner, upstream's systemd
unit. Replaces stpweb's gitea-runner/ and stpbuild's untracked copy,
both started by @reboot cron.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
2026-11-27 13:43:11 +00:00
co-authored by Claude Opus 5.5
commit ee25ab4abb
6 changed files with 269 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
# Installed by install.sh, which fills in the @...@ values. Based on
# upstream's examples/systemd/gitea-runner.service.
[Unit]
Description=Gitea Actions runner (stprunner)
Documentation=https://gitea.com/gitea/runner
After=network-online.target docker.service
Wants=network-online.target
# Wants, not Requires: a no-op on hosts without Docker.
Wants=docker.service
[Service]
Type=simple
# Host-mode jobs run as this user with its groups (docker), HOME and SSH key.
User=@USER@
WorkingDirectory=@STATE@
ExecStart=@BIN@ daemon --config @STATE@/config.yaml
# Also covers Gitea being unreachable at boot, so no wait loop is needed.
Restart=always
RestartSec=10s
# Let running jobs finish; keep in sync with runner.shutdown_timeout.
KillMode=mixed
TimeoutStopSec=3h
[Install]
WantedBy=multi-user.target