code-forge/start-action-runner.sh

24 lines
1.1 KiB
Bash
Raw Normal View History

#!/usr/bin/bash
2024-10-14 00:09:12 +00:00
RUNNER_VERSION=3.5.1
2024-07-30 00:21:16 +00:00
wget -O "$FORGEJO_RUNNER_ROOT"/forgejo-runner https://code.forgejo.org/forgejo/runner/releases/download/v$RUNNER_VERSION/forgejo-runner-$RUNNER_VERSION-linux-amd64
chmod +x "$FORGEJO_RUNNER_ROOT"/forgejo-runner
2024-07-30 00:21:16 +00:00
wget -O forgejo-runner.asc https://code.forgejo.org/forgejo/runner/releases/download/v$RUNNER_VERSION/forgejo-runner-$RUNNER_VERSION-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."
(
cp ./config.yml "$FORGEJO_RUNNER_ROOT/config.yml"
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