Add deploy-fast.sh — local build + docker cp (~5s vs ~30s)

No Docker image rebuild needed. Builds PWA locally with npx quasar
then copies dist/pwa directly into the ERPNext frontend container.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
louispaulb 2026-03-24 16:12:07 -04:00
parent 632e4ae0d1
commit a5822f7a5b

29
deploy-fast.sh Executable file
View File

@ -0,0 +1,29 @@
#!/bin/bash
# ─────────────────────────────────────────────────────────────────────────────
# deploy-fast.sh — Build locally + copy to ERPNext container (no Docker build)
#
# ~5-8s vs ~30s with deploy.sh
#
# Usage:
# chmod +x deploy-fast.sh
# ./deploy-fast.sh
# ─────────────────────────────────────────────────────────────────────────────
set -e
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
CONTAINER="frappe_docker-frontend-1"
DEST="/home/frappe/frappe-bench/sites/assets/dispatch-app"
cd "$SCRIPT_DIR"
echo "==> Building PWA locally..."
npx quasar build -m pwa
echo "==> Deploying to $CONTAINER..."
docker exec "$CONTAINER" mkdir -p "$DEST"
docker cp "$SCRIPT_DIR/dist/pwa/." "$CONTAINER:$DEST/"
echo ""
echo "Done! (~$(date +%Ss))"
echo " Dispatch : http://localhost:8080/assets/dispatch-app/index.html"
echo " Mobile : http://localhost:8080/assets/dispatch-app/index.html#/mobile"