do not try to install the runner if it already available

This commit is contained in:
Earl Warren 2023-04-04 18:24:21 +02:00
parent f66ab11375
commit e97991ef78
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00

View file

@ -13,8 +13,10 @@ function download() {
local runner_repository="$1"
local version="$2"
if ! which forgejo-runner > /dev/null; then
curl -L --fail -sS $runner_repository/releases/download/$version/forgejo-runner-amd64 > /bin/forgejo-runner
chmod 755 /bin/forgejo-runner
fi
}
function register() {
@ -24,7 +26,8 @@ function register() {
}
function run() {
daemon --chdir=$(pwd) --unsafe --pidfile=$(pwd)/forgejo-runner-pid --errlog=$(pwd)/forgejo-runner.log --output=$(pwd)/forgejo-runner.log /bin/forgejo-runner daemon
rm -f forgejo-runner.log
daemon --chdir=$(pwd) --unsafe --pidfile=$(pwd)/forgejo-runner-pid --errlog=$(pwd)/forgejo-runner.log --output=$(pwd)/forgejo-runner.log forgejo-runner daemon
sleep 1
cat forgejo-runner.log
}