From f533af82cdf136c64244b7edff27cedb6365b83e Mon Sep 17 00:00:00 2001 From: cproudlock Date: Tue, 28 Jul 2026 08:28:42 -0400 Subject: [PATCH] export: --dist builds both /ops and /shopdb frontend bases Two instances run on the box (dev /ops + prod /shopdb); each needs its own base-path build. Build both on every --dist so prod never ships a stale frontend. tools/ is excluded from publication, so this is dev-tooling only. --- tools/export-github.sh | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/tools/export-github.sh b/tools/export-github.sh index 01a8603..57ba985 100755 --- a/tools/export-github.sh +++ b/tools/export-github.sh @@ -8,7 +8,8 @@ # # Usage: # tools/export-github.sh "Commit message for the publication commit" -# tools/export-github.sh --dist # also rebuild the /ops frontend dist +# tools/export-github.sh --dist # also rebuild BOTH frontend dists +# # (/ops = dev, /shopdb = prod) # # This script lives in tools/, which is itself excluded from publication. set -euo pipefail @@ -111,13 +112,17 @@ git bundle create "$OUT/shopdb-flask-pub.bundle" HEAD main --tags git bundle verify "$OUT/shopdb-flask-pub.bundle" >/dev/null echo "bundle: $OUT/shopdb-flask-pub.bundle" -# --- 6. optional /ops dist for the prod server --- +# --- 6. optional per-instance dists (both bases: /ops = dev, /shopdb = prod) --- +# Two instances run on the box; each needs its own base-path build. Always +# rebuild BOTH so prod never ships a stale frontend. if [ "$BUILD_DIST" = 1 ]; then cd "$WORK/frontend" - VITE_BASE_PATH=/ops/ npm run build --silent - rm -rf "$OUT/frontend-dist-subpath-ops" - cp -r dist "$OUT/frontend-dist-subpath-ops" - echo "dist: $OUT/frontend-dist-subpath-ops/" + for base in ops shopdb; do + VITE_BASE_PATH=/$base/ npm run build --silent + rm -rf "$OUT/frontend-dist-subpath-$base" + cp -r dist "$OUT/frontend-dist-subpath-$base" + echo "dist: $OUT/frontend-dist-subpath-$base/ (base /$base/)" + done fi cat <<'EOF'