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"