diff --git a/ops/gitea-act-runner-config.yaml b/ops/gitea-act-runner-config.yaml index 7e84266..df7aef1 100644 --- a/ops/gitea-act-runner-config.yaml +++ b/ops/gitea-act-runner-config.yaml @@ -8,4 +8,3 @@ runner: container: network: web - options: --pull=always diff --git a/ops/install-gitea-act-runner.sh b/ops/install-gitea-act-runner.sh index b3cdeeb..6a10d2f 100644 --- a/ops/install-gitea-act-runner.sh +++ b/ops/install-gitea-act-runner.sh @@ -8,7 +8,8 @@ readonly RUNNER_DIR="/opt/manus-deploy/gitea-runner" readonly GITEA_CONTAINER="gitea" readonly GITEA_URL="https://git.recette.santinova-soft.org" readonly RUNNER_NAME="recette-docker-runner" -readonly RUNNER_LABELS="ubuntu-latest:docker://node:22-bookworm" +readonly RUNNER_LABELS="ubuntu-latest:docker://node:20-alpine" +readonly LABEL_FILE="${RUNNER_DIR}/labels" install -d -m 0750 "${RUNNER_DIR}" install -m 0640 "${SCRIPT_DIR}/gitea-act-runner-config.yaml" "${RUNNER_DIR}/config.yaml" @@ -19,7 +20,9 @@ if [[ ! -f "${RUNNER_DIR}/.runner" && -f "${APP_DIR}/.runner" ]]; then mv "${APP_DIR}/.runner" "${RUNNER_DIR}/.runner" fi -if [[ ! -f "${RUNNER_DIR}/.runner" ]]; then +if [[ ! -f "${RUNNER_DIR}/.runner" || ! -f "${LABEL_FILE}" || "$(<"${LABEL_FILE}")" != "${RUNNER_LABELS}" ]]; then + systemctl stop gitea-act-runner.service 2>/dev/null || true + rm -f "${RUNNER_DIR}/.runner" token="$(docker exec -u git "${GITEA_CONTAINER}" gitea actions generate-runner-token)" ( cd "${RUNNER_DIR}" @@ -30,6 +33,7 @@ if [[ ! -f "${RUNNER_DIR}/.runner" ]]; then --labels "${RUNNER_LABELS}" \ --config "${RUNNER_DIR}/config.yaml" ) + printf '%s\n' "${RUNNER_LABELS}" > "${LABEL_FILE}" fi systemctl daemon-reload