From 122d8fa65924740953642dc272243867d8e991fe Mon Sep 17 00:00:00 2001 From: dadachann <185672915+dadachann@users.noreply.github.com> Date: Thu, 30 Jul 2026 14:34:20 +0000 Subject: [PATCH] fix(deploy): retry transient image pull failures --- deploy/prod/deploy.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/deploy/prod/deploy.sh b/deploy/prod/deploy.sh index 5bbf3b77e..3916a2c17 100755 --- a/deploy/prod/deploy.sh +++ b/deploy/prod/deploy.sh @@ -45,7 +45,18 @@ set -a . ./.env set +a -docker compose pull postgres redis migrate plugin-runtime box core +for attempt in 1 2 3 4 5; do + if docker compose pull postgres redis migrate plugin-runtime box core; then + break + fi + if [ "$attempt" -eq 5 ]; then + echo "docker compose pull failed after $attempt attempts" >&2 + exit 1 + fi + delay=$((attempt * 10)) + echo "docker compose pull failed (attempt $attempt/5); retrying in ${delay}s" >&2 + sleep "$delay" +done docker compose up -d postgres redis for _ in $(seq 1 60); do if docker compose exec -T postgres pg_isready -U langbot_operator -d langbot >/dev/null 2>&1; then break; fi