fix(ci): conserver l enregistrement du runner Gitea
This commit is contained in:
@@ -7,6 +7,7 @@ Wants=network-online.target
|
|||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=simple
|
||||||
User=root
|
User=root
|
||||||
|
WorkingDirectory=/opt/manus-deploy/gitea-runner
|
||||||
Environment=DOCKER_HOST=unix:///var/run/docker.sock
|
Environment=DOCKER_HOST=unix:///var/run/docker.sock
|
||||||
ExecStart=/usr/local/bin/act_runner daemon --config /opt/manus-deploy/gitea-runner/config.yaml
|
ExecStart=/usr/local/bin/act_runner daemon --config /opt/manus-deploy/gitea-runner/config.yaml
|
||||||
Restart=always
|
Restart=always
|
||||||
|
|||||||
@@ -15,12 +15,15 @@ install -D -m 0644 "${SCRIPT_DIR}/gitea-act-runner.service" /etc/systemd/system/
|
|||||||
|
|
||||||
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)"
|
||||||
|
(
|
||||||
|
cd "${RUNNER_DIR}"
|
||||||
/usr/local/bin/act_runner register --no-interactive \
|
/usr/local/bin/act_runner register --no-interactive \
|
||||||
--instance "${GITEA_URL}" \
|
--instance "${GITEA_URL}" \
|
||||||
--token "${token}" \
|
--token "${token}" \
|
||||||
--name "${RUNNER_NAME}" \
|
--name "${RUNNER_NAME}" \
|
||||||
--labels "${RUNNER_LABELS}" \
|
--labels "${RUNNER_LABELS}" \
|
||||||
--config "${RUNNER_DIR}/config.yaml"
|
--config "${RUNNER_DIR}/config.yaml"
|
||||||
|
)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
systemctl daemon-reload
|
systemctl daemon-reload
|
||||||
|
|||||||
Reference in New Issue
Block a user