#!/usr/bin/env bash # Build MIM4U frontend and deploy to VMID 7810 /var/www/html. # Run from project root. Requires: npm in miracles_in_motion, ssh to Proxmox node, rsync or scp. # # Usage: ./scripts/mim4u-deploy-to-7810.sh set -euo pipefail SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)" MIM_ROOT="${PROJECT_ROOT}/miracles_in_motion" [[ -f "$PROJECT_ROOT/config/ip-addresses.conf" ]] && source "$PROJECT_ROOT/config/ip-addresses.conf" 2>/dev/null || true VMID_MIM_WEB="${VMID_MIM_WEB:-7810}" PROXMOX_HOST="${PROXMOX_HOST_R630_02:-192.168.11.12}" MIM_WEB_IP="${IP_MIM_WEB:-192.168.11.37}" DEST="/var/www/html" echo "Building MIM4U frontend..." (cd "$MIM_ROOT" && npm run build) echo "Deploying dist to root@$PROXMOX_HOST (pct exec $VMID_MIM_WEB) at $DEST ..." # Copy into container: tar from host, extract in container tar czf - -C "$MIM_ROOT/dist" . | ssh "root@$PROXMOX_HOST" "pct exec $VMID_MIM_WEB -- tar xzf - -C $DEST" echo "Done. Verify: curl -I http://${MIM_WEB_IP}:80/"