act runner
This commit is contained in:
20
playbooks/files/act_runner-updater.sh
Normal file
20
playbooks/files/act_runner-updater.sh
Normal file
@@ -0,0 +1,20 @@
|
||||
#!/bin/bash
|
||||
|
||||
error () {
|
||||
printf '%s\n' "=== Failed to update ==="
|
||||
exit 1
|
||||
}
|
||||
|
||||
echo "=== Updating Act Runner to v$1 ==="
|
||||
|
||||
systemctl stop act_runner.service || error
|
||||
|
||||
wget -nv -O /usr/local/bin/act_runner https://gitea.com/gitea/act_runner/releases/download/v$1/act_runner-$1-linux-amd64 || error
|
||||
|
||||
systemctl start act_runner.service || error
|
||||
|
||||
systemctl is-active act_runner.service || error
|
||||
|
||||
systemctl status act_runner.service || error
|
||||
|
||||
echo "=== Update finished ==="
|
||||
16
playbooks/files/act_runner.service
Normal file
16
playbooks/files/act_runner.service
Normal file
@@ -0,0 +1,16 @@
|
||||
[Unit]
|
||||
Description=Gitea Actions runner
|
||||
Documentation=https://docs.gitea.com/usage/actions/act-runner
|
||||
After=docker.service
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/local/bin/act_runner daemon --config /opt/runner/config.yml
|
||||
ExecReload=/bin/kill -s HUP $MAINPID
|
||||
WorkingDirectory=/opt/runner
|
||||
TimeoutSec=0
|
||||
RestartSec=10
|
||||
Restart=always
|
||||
User=runner
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
36
playbooks/files/runner-config.yml
Normal file
36
playbooks/files/runner-config.yml
Normal file
@@ -0,0 +1,36 @@
|
||||
log:
|
||||
# The level of logging, can be trace, debug, info, warn, error, fatal
|
||||
level: info
|
||||
|
||||
runner:
|
||||
file: .runner
|
||||
capacity: 1
|
||||
envs:
|
||||
env_file: .env
|
||||
timeout: 10m
|
||||
insecure: false
|
||||
fetch_timeout: 5s
|
||||
fetch_interval: 2s
|
||||
|
||||
cache:
|
||||
enabled: true
|
||||
# If it's empty, the cache data will be stored in $HOME/.cache/actcache.
|
||||
dir: ""
|
||||
# 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.
|
||||
host: ""
|
||||
# The port of the cache server.
|
||||
# 0 means to use a random available port.
|
||||
port: 0
|
||||
|
||||
container:
|
||||
# Which network to use for the job containers. Could be bridge, host, none, or the name of a custom network.
|
||||
network: proxy-net
|
||||
# Whether to use privileged mode or not when launching task containers (privileged mode is required for Docker-in-Docker).
|
||||
privileged: false
|
||||
# And other options to be used when the container is started (eg, --add-host=my.gitea.url:host-gateway).
|
||||
options:
|
||||
# The parent directory of a job's working directory.
|
||||
# If it's empty, /workspace will be used.
|
||||
workdir_parent:
|
||||
Reference in New Issue
Block a user