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.
This commit is contained in:
@@ -8,7 +8,8 @@
|
|||||||
#
|
#
|
||||||
# Usage:
|
# Usage:
|
||||||
# tools/export-github.sh "Commit message for the publication commit"
|
# 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.
|
# This script lives in tools/, which is itself excluded from publication.
|
||||||
set -euo pipefail
|
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
|
git bundle verify "$OUT/shopdb-flask-pub.bundle" >/dev/null
|
||||||
echo "bundle: $OUT/shopdb-flask-pub.bundle"
|
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
|
if [ "$BUILD_DIST" = 1 ]; then
|
||||||
cd "$WORK/frontend"
|
cd "$WORK/frontend"
|
||||||
VITE_BASE_PATH=/ops/ npm run build --silent
|
for base in ops shopdb; do
|
||||||
rm -rf "$OUT/frontend-dist-subpath-ops"
|
VITE_BASE_PATH=/$base/ npm run build --silent
|
||||||
cp -r dist "$OUT/frontend-dist-subpath-ops"
|
rm -rf "$OUT/frontend-dist-subpath-$base"
|
||||||
echo "dist: $OUT/frontend-dist-subpath-ops/"
|
cp -r dist "$OUT/frontend-dist-subpath-$base"
|
||||||
|
echo "dist: $OUT/frontend-dist-subpath-$base/ (base /$base/)"
|
||||||
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cat <<'EOF'
|
cat <<'EOF'
|
||||||
|
|||||||
Reference in New Issue
Block a user