This commit is contained in:
@@ -47,16 +47,22 @@ while true; do
|
||||
echo "[$(date -Iseconds)] New commits detected! Updating..."
|
||||
echo " Previous: $LAST_HASH"
|
||||
echo " Current: $REMOTE_HASH"
|
||||
|
||||
git pull origin main 2>&1 || {
|
||||
echo "[$(date -Iseconds)] ERROR: git pull failed, retrying in 20s..."
|
||||
LAST_HASH=""
|
||||
sleep 20
|
||||
continue
|
||||
}
|
||||
|
||||
echo "[$(date -Iseconds)] Bringing containers down..."
|
||||
docker compose -f "$COMPOSE_FILE" down 2>&1
|
||||
else
|
||||
echo "[$(date -Iseconds)] First run — pulling and launching containers..."
|
||||
git pull origin main 2>&1 || {
|
||||
echo "[$(date -Iseconds)] ERROR: git pull failed, retrying in 20s..."
|
||||
sleep 20
|
||||
continue
|
||||
}
|
||||
fi
|
||||
|
||||
echo "[$(date -Iseconds)] Building images..."
|
||||
docker compose -f "$COMPOSE_FILE" build 2>&1
|
||||
@@ -65,9 +71,6 @@ while true; do
|
||||
docker compose -f "$COMPOSE_FILE" up -d 2>&1
|
||||
|
||||
echo "[$(date -Iseconds)] Update complete."
|
||||
else
|
||||
echo "[$(date -Iseconds)] Initial state recorded: $REMOTE_HASH"
|
||||
fi
|
||||
LAST_HASH="$REMOTE_HASH"
|
||||
else
|
||||
echo "[$(date -Iseconds)] No changes."
|
||||
|
||||
Reference in New Issue
Block a user