initial runner deployment

This commit is contained in:
Lilian 2025-02-04 18:00:36 -05:00
parent d3bcffdab8
commit e189886c5b
5 changed files with 28 additions and 5 deletions

2
.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
# forgejo actions runner registration token
.runner

View file

@ -3,5 +3,5 @@ Description=Rebuild Forgejo Actions containers
[Service]
Type=oneshot
ExecStart=/etc/forgejo-runner/build-containers.sh
ExecStart=/etc/forgejo-actions/build-containers.sh
Restart=no

View file

@ -1,6 +1,6 @@
#!/usr/bin/env bash
BASEDIR=/etc/forgejo-runner
BASEDIR=/etc/forgejo-actions
for container in "$BASEDIR"/Containerfile.*; do
base=$(basename "$container")

View file

@ -6,7 +6,7 @@ log:
runner:
# Where to store the registration result.
file: /etc/forgejo-runner/.runner
file: /etc/forgejo-actions/.runner
# Execute how many tasks concurrently at the same time.
capacity: 1
# Extra environment variables to run jobs.
@ -43,7 +43,7 @@ cache:
enabled: true
# The directory to store the cache data.
# If it's empty, the cache data will be stored in $HOME/.cache/actcache.
dir: "/var/cache/forgejo-actions"
dir: "/mnt/cache/forgejo-actions"
# The host of the cache server.
# It's not for the address to listen, but the address to connect from job containers.
# So 0.0.0.0 is a bad choice, leave it empty to detect automatically.
@ -86,7 +86,7 @@ container:
# If "-" or "", an available docker host will automatically be found.
# If "automount", an available docker host will automatically be found and mounted in the job container (e.g. /var/run/docker.sock).
# Otherwise the specified docker host will be used and an error will be returned if it doesn't work.
docker_host: "/var/run/podman/podman.sock"
docker_host: ""
# Pull docker image(s) even if already present
force_pull: false
# Rebuild local docker image(s) even if already present

21
forgejo-runner.service Normal file
View file

@ -0,0 +1,21 @@
[Unit]
Description=Forgejo Runner
Documentation=https://forgejo.org/docs/latest/admin/actions/
After=podman.service podman.socket network-online.target
Wants=podman.service
[Service]
ExecStart=forgejo-runner daemon --config /etc/forgejo-actions/config.yml
ExecReload=/bin/kill -s HUP $MAINPID
Environment="DOCKER_HOST=unix:///run/podman/podman.sock"
# This user and working directory must already exist
User=runner
WorkingDirectory=/home/runner
Restart=on-failure
TimeoutSec=0
RestartSec=10
[Install]
WantedBy=multi-user.target