From 9c7db8580db43e0c05f8812bc09dc22600bcd5e1 Mon Sep 17 00:00:00 2001 From: JasonFraser Date: Sat, 3 Oct 2026 14:14:31 -0400 Subject: [PATCH] Document exact step-by-step execution order in dev.sh/prod.sh headers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Spells out what actually happens on each run, in order, including the hard-stop-at-any-step behavior in prod.sh's gates — so reading the header is enough to know the full sequence without tracing through the script. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_012pc2x7vyuUofdT3kLuqF3Y --- scripts/dev.sh | 14 ++++++++++++++ scripts/prod.sh | 22 ++++++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/scripts/dev.sh b/scripts/dev.sh index 0f7d11f..46a4018 100755 --- a/scripts/dev.sh +++ b/scripts/dev.sh @@ -6,6 +6,20 @@ # as often as you want while developing; nothing here touches git or the # registry — see scripts/prod.sh for shipping what you've tested here. # +# What happens when this runs, in order: +# 1. ./erpnext-image/build.sh — CUSTOM_IMAGE in the root .env is a bare +# local tag (not a registry path), so this takes the local branch: +# builds sightbox-erpnext for this machine's own architecture, no push. +# 2. ./backend/build.sh — same thing for BACKEND_BILLING_IMAGE: builds +# sightbox-backend-billing locally, no push. +# 3. docker compose up -d --force-recreate on every service that runs +# from either image — the seven ERPNext-image services (configurator, +# backend, frontend, websocket, queue-short, queue-long, scheduler) +# plus backend-billing — so the freshly-built images actually get +# picked up. (Compose has no "recreate everyone using image X" — it +# only accepts service names, so all eight get listed individually +# even though only one or two images actually changed.) +# # Usage (from the sightbox/ project root or from here — either works): # ./scripts/dev.sh diff --git a/scripts/prod.sh b/scripts/prod.sh index 134b1de..2b97e8f 100755 --- a/scripts/prod.sh +++ b/scripts/prod.sh @@ -21,6 +21,28 @@ # prod.sh run. Add those three to .env.prod yourself if you'd rather # switch entirely to the direct-API trigger instead. # +# What happens when this runs, in order — a hard stop at any step means +# nothing after it ever runs: +# 1. Branch check — exits unless currently on main. +# 2. Clean-tree check — exits if `git status --porcelain` shows anything +# uncommitted, so what ships always matches an actual commit. +# 3. Loads scripts/.env.prod — exits if it doesn't exist yet; otherwise +# exports the real CUSTOM_IMAGE/CUSTOM_TAG/BACKEND_BILLING_IMAGE/ +# BACKEND_BILLING_TAG registry paths into this shell. +# 4. Runs backend/tests/ via pytest — any failure stops here, before +# anything is built or pushed. +# 5. ./erpnext-image/build.sh — sees the registry-path CUSTOM_IMAGE from +# step 3, takes its registry branch: builds for linux/amd64 via +# buildx (not this machine's own arch) and pushes straight to the +# registry. +# 6. ./backend/build.sh — same thing for backend-billing: builds for +# linux/amd64, pushes to the registry. DOKPLOY_URL/DOKPLOY_API_TOKEN/ +# DOKPLOY_COMPOSE_ID are deliberately unset (see above), so this step +# stops after pushing — it does not call Dokploy's API itself. +# 7. git push origin main — the actual deploy trigger. Dokploy's +# AutoDeploy watches main and redeploys on push, pulling both +# freshly-pushed images. +# # Usage: ./scripts/prod.sh set -euo pipefail