code-forge/start-action-runner.sh

21 lines
957 B
Bash
Raw Normal View History

#!/usr/bin/bash
wget -O "$FORGEJO_RUNNER_ROOT"/forgejo-runner https://code.forgejo.org/forgejo/runner/releases/download/v3.3.0/forgejo-runner-3.3.0-linux-amd64
chmod +x "$FORGEJO_RUNNER_ROOT"/forgejo-runner
wget -O forgejo-runner.asc https://code.forgejo.org/forgejo/runner/releases/download/v3.3.0/forgejo-runner-3.3.0-linux-amd64.asc
gpg --keyserver keys.openpgp.org --recv EB114F5E6C0DC2BCDD183550A4B61A2DC5923710
gpg --verify forgejo-runner.asc "$FORGEJO_RUNNER_ROOT"/forgejo-runner
rm forgejo-runner.asc
if [ -f "$FORGEJO_RUNNER_ROOT/.runner" ]; then
echo "Found runner state."
(
cd "$FORGEJO_RUNNER_ROOT" || exit
"$FORGEJO_RUNNER_ROOT"/forgejo-runner --config "${FORGEJO_RUNNER_CONFIG:=./config.yml}" daemon &
)
else
echo "Use $FORGEJO_RUNNER_ROOT/forgejo-runner register ... to register the runner"
echo "Once registered, use $FORGEJO_RUNNER_ROOT/forgejo-runner --config <path-to-config> daemon & to start"
fi