From 1107bc83b333a157dfe402965457bbee258f72a8 Mon Sep 17 00:00:00 2001 From: Pepe44DEV Date: Sun, 6 Sep 2026 23:38:03 +0000 Subject: [PATCH] feat(deploy): deployer self-reloads its own script from git each poll --- infrastructure/deploy/deploy.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/infrastructure/deploy/deploy.sh b/infrastructure/deploy/deploy.sh index da584bc..e4d1dfb 100755 --- a/infrastructure/deploy/deploy.sh +++ b/infrastructure/deploy/deploy.sh @@ -185,6 +185,13 @@ log "Fleet Forge deployer started (poll every ${POLL_INTERVAL}s, branch $GIT_BRA mkdir -p "$SRC" "$CERT_DIR" "/cfg" while true; do + if [ -f "$SRC/infrastructure/deploy/deploy.sh" ] && ! cmp -s "$0" "$SRC/infrastructure/deploy/deploy.sh"; then + log "self-updating deploy script from repo" + cp "$SRC/infrastructure/deploy/deploy.sh" "$0" + chmod +x "$0" + exec "$0" + fi + if ! HEAD=$(clone_or_pull 2>>/dev/stderr); then log "git update failed, retrying in ${POLL_INTERVAL}s" sleep "$POLL_INTERVAL"