feat(deploy): deployer self-reloads its own script from git each poll
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user