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'