mirror of
https://git.cloudron.io/cloudron/gitea-app
synced 2025-09-28 16:07:24 +00:00
make act_runner re-register on every restart
This commit is contained in:
17
start.sh
17
start.sh
@@ -31,19 +31,20 @@ setup_root_user() {
|
||||
setup_act_runner() {
|
||||
wait_for_gitea
|
||||
|
||||
echo "==> Setup act_runner"
|
||||
if [[ ! -f /app/data/act_runner/config.yaml ]]; then
|
||||
gosu git act_runner generate-config > /app/data/act_runner/config.yaml
|
||||
fi
|
||||
yq -e -i ".runner.file=\"/app/data/act_runner/.runner\"" /app/data/act_runner/config.yaml
|
||||
|
||||
if [[ ! -f /app/data/act_runner/.runner ]]; then
|
||||
echo "==> Setup act_runner"
|
||||
|
||||
RUNNER_TOKEN=$(gosu git /home/git/gitea/gitea --config /run/gitea/app.ini actions generate-runner-token)
|
||||
|
||||
echo "===> act_runner token: ${RUNNER_TOKEN}"
|
||||
if [[ ! -f /app/data/act_runner/config.yaml ]]; then
|
||||
gosu git act_runner generate-config > /app/data/act_runner/config.yaml
|
||||
fi
|
||||
yq -e -i ".runner.file=\"/app/data/act_runner/.runner\"" /app/data/act_runner/config.yaml
|
||||
|
||||
echo "===> Register act_runner"
|
||||
gosu git act_runner register --instance http://localhost:3000 --token ${RUNNER_TOKEN} --name 'cloudron-runner' --config /app/data/act_runner/config.yaml --no-interactive
|
||||
gosu git act_runner register --instance ${CLOUDRON_APP_ORIGIN} --token ${RUNNER_TOKEN} --name 'cloudron-runner' --config /app/data/act_runner/config.yaml --no-interactive
|
||||
else
|
||||
yq -e -i ".address=\"${CLOUDRON_APP_ORIGIN}\"" /app/data/act_runner/.runner
|
||||
fi
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user