Improve deployment script reliability and add explicit seed step
Update redeploy.sh to include an explicit seed step and adjust script numbering and help output. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 77cfe984-2c65-4152-bb7a-0df28274fe66 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Event-Id: ca6e30a4-b773-4707-8e0c-a72cb5bddf70 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/c3c252e4-c83d-40ca-9fff-99a3ea60701e/77cfe984-2c65-4152-bb7a-0df28274fe66/T9daF3x Replit-Helium-Checkpoint-Created: true
This commit is contained in:
+16
-6
@@ -13,8 +13,14 @@
|
|||||||
# 2. docker compose build api web
|
# 2. docker compose build api web
|
||||||
# — rebuild both images so source + static assets are fresh
|
# — rebuild both images so source + static assets are fresh
|
||||||
# 3. docker compose run --rm migrate
|
# 3. docker compose run --rm migrate
|
||||||
# — apply Drizzle schema + run the seed (idempotent)
|
# — apply Drizzle schema (migrate.sh also runs the seed,
|
||||||
# 4. docker compose up -d
|
# but tolerates seed failures — see step 4)
|
||||||
|
# 4. docker compose run --rm --entrypoint "" --no-deps migrate \
|
||||||
|
# pnpm --filter @workspace/scripts run seed
|
||||||
|
# — explicit seed pass that fails hard if the seed
|
||||||
|
# errors. Catches new-app / renamed-app regressions
|
||||||
|
# that migrate.sh would otherwise swallow.
|
||||||
|
# 5. docker compose up -d
|
||||||
# — restart api + web with the new images
|
# — restart api + web with the new images
|
||||||
#
|
#
|
||||||
# Safe to re-run. Each step is idempotent.
|
# Safe to re-run. Each step is idempotent.
|
||||||
@@ -26,7 +32,7 @@ for arg in "$@"; do
|
|||||||
case "$arg" in
|
case "$arg" in
|
||||||
--no-pull) PULL=0 ;;
|
--no-pull) PULL=0 ;;
|
||||||
-h|--help)
|
-h|--help)
|
||||||
sed -n '2,21p' "$0"
|
sed -n '2,27p' "$0"
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
@@ -72,13 +78,17 @@ else
|
|||||||
step "1/4 git pull (skipped via --no-pull)"
|
step "1/4 git pull (skipped via --no-pull)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
step "2/4 docker compose build api web (rebuilds SPA + API images)"
|
step "2/5 docker compose build api web (rebuilds SPA + API images)"
|
||||||
"${DC[@]}" build api web
|
"${DC[@]}" build api web
|
||||||
|
|
||||||
step "3/4 docker compose run --rm migrate (schema push + seed)"
|
step "3/5 docker compose run --rm migrate (schema push + tolerant seed)"
|
||||||
"${DC[@]}" run --rm migrate
|
"${DC[@]}" run --rm migrate
|
||||||
|
|
||||||
step "4/4 docker compose up -d (restart with the new images)"
|
step "4/5 explicit seed pass (fails hard on seed regressions)"
|
||||||
|
"${DC[@]}" run --rm --no-deps --entrypoint "" migrate \
|
||||||
|
pnpm --filter @workspace/scripts run seed
|
||||||
|
|
||||||
|
step "5/5 docker compose up -d (restart with the new images)"
|
||||||
"${DC[@]}" up -d
|
"${DC[@]}" up -d
|
||||||
|
|
||||||
echo
|
echo
|
||||||
|
|||||||
Reference in New Issue
Block a user