OSS-BSS-Field-Dispatch/deploy.sh
louispaulb 5e6f20d871 Initial commit — dispatch app baseline before Quasar migration
Current state: custom CSS + vanilla Vue components
Architecture: modular with composables, provide/inject pattern
Ready for progressive migration to Quasar native components

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 13:35:49 -04:00

42 lines
1.6 KiB
Bash
Executable File

#!/bin/bash
# ─────────────────────────────────────────────────────────────────────────────
# deploy.sh — Build the Quasar PWA and deploy to ERPNext Docker
#
# Usage:
# chmod +x deploy.sh
# ./deploy.sh
#
# Accès après déploiement :
# http://localhost:8080/assets/dispatch-app/
# http://localhost:8080/assets/dispatch-app/#/mobile
#
# To change the target container or path, edit CONTAINER and DEST below.
# ─────────────────────────────────────────────────────────────────────────────
set -e
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
CONTAINER="frappe_docker-frontend-1"
DEST="/home/frappe/frappe-bench/sites/assets/dispatch-app"
IMAGE="dispatch-app-builder"
echo "==> Building Docker image..."
docker build -t "$IMAGE" "$SCRIPT_DIR"
echo "==> Extracting build artifacts..."
TMPDIR="$(mktemp -d)"
# Create a temporary container (not running) to copy files out
CID=$(docker create "$IMAGE")
docker cp "$CID:/app/dist/pwa/." "$TMPDIR/"
docker rm "$CID"
echo "==> Deploying to ERPNext container ($CONTAINER:$DEST)..."
docker exec "$CONTAINER" mkdir -p "$DEST"
docker cp "$TMPDIR/." "$CONTAINER:$DEST/"
rm -rf "$TMPDIR"
echo ""
echo "Done!"
echo " Dispatch : http://localhost:8080/assets/dispatch-app/index.html"
echo " Mobile : http://localhost:8080/assets/dispatch-app/index.html#/mobile"