fix(ci): migrer l enregistrement runner existant

This commit is contained in:
Manus AI
2026-08-18 08:32:45 +00:00
parent 7defcabdc3
commit 7270e1a89a

View File

@@ -3,6 +3,7 @@
set -Eeuo pipefail set -Eeuo pipefail
readonly SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" readonly SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
readonly APP_DIR="$(dirname "${SCRIPT_DIR}")"
readonly RUNNER_DIR="/opt/manus-deploy/gitea-runner" readonly RUNNER_DIR="/opt/manus-deploy/gitea-runner"
readonly GITEA_CONTAINER="gitea" readonly GITEA_CONTAINER="gitea"
readonly GITEA_URL="https://git.recette.santinova-soft.org" readonly GITEA_URL="https://git.recette.santinova-soft.org"
@@ -13,6 +14,11 @@ install -d -m 0750 "${RUNNER_DIR}"
install -m 0640 "${SCRIPT_DIR}/gitea-act-runner-config.yaml" "${RUNNER_DIR}/config.yaml" install -m 0640 "${SCRIPT_DIR}/gitea-act-runner-config.yaml" "${RUNNER_DIR}/config.yaml"
install -D -m 0644 "${SCRIPT_DIR}/gitea-act-runner.service" /etc/systemd/system/gitea-act-runner.service install -D -m 0644 "${SCRIPT_DIR}/gitea-act-runner.service" /etc/systemd/system/gitea-act-runner.service
# Migration unique : les versions antérieures enregistraient le runner dans APP_DIR.
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" ]]; then
token="$(docker exec -u git "${GITEA_CONTAINER}" gitea actions generate-runner-token)" token="$(docker exec -u git "${GITEA_CONTAINER}" gitea actions generate-runner-token)"
( (