Files
L'électron rareandClaude Opus 4.6 619f9163c6 feat(web): add aperant renderer, cockpit components, EDA worker
- Aperant: Vite build, shims, deploy script, dist assets
- Cockpit components: Card, Badge, Modal, Input, DataTable, StatusDot
- EDA worker for browser-side PCB/schematic processing
- Next.js project config, CI pipeline, layout

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
2026-03-24 00:22:28 +01:00

59 lines
2.5 KiB
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
# ─────────────────────────────────────────────────────────────────
# Deploy Aperant Web to tower ([email protected])
# Target: aperant.saillant.cc
# ─────────────────────────────────────────────────────────────────
SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
ROOT_DIR="$(cd -- "${SCRIPT_DIR}/../.." && pwd)"
TOWER_HOST="[email protected]"
TOWER_APP_DIR="/home/clems/aperant-web"
DOMAIN="aperant.saillant.cc"
echo "── Aperant Web Deploy → ${DOMAIN} (tower)"
echo ""
# ── Step 1: Build locally ────────────────────────────────────────
echo "[1/5] Building web UI …"
(cd "${SCRIPT_DIR}" && npm run build)
# ── Step 2: Ensure remote directory ─────────────────────────────
echo "[2/5] Preparing tower …"
ssh "${TOWER_HOST}" "mkdir -p ${TOWER_APP_DIR}/{dist,server}"
# ── Step 3: Sync build artifacts ────────────────────────────────
echo "[3/5] Syncing build → tower …"
rsync -az --delete \
"${SCRIPT_DIR}/dist/" \
"${TOWER_HOST}:${TOWER_APP_DIR}/dist/"
rsync -az \
"${SCRIPT_DIR}/server/" \
"${TOWER_HOST}:${TOWER_APP_DIR}/server/"
rsync -az \
"${SCRIPT_DIR}/package.json" \
"${SCRIPT_DIR}/tsconfig.json" \
"${TOWER_HOST}:${TOWER_APP_DIR}/"
# ── Step 4: Install server deps + build server on tower ─────────
echo "[4/5] Installing deps on tower …"
ssh "${TOWER_HOST}" "cd ${TOWER_APP_DIR} && npm install --omit=dev 2>&1 | tail -3"
# ── Step 5: Restart service ─────────────────────────────────────
echo "[5/5] Restarting aperant-web service …"
ssh "${TOWER_HOST}" "cd ${TOWER_APP_DIR} && \
(pm2 delete aperant-web 2>/dev/null || true) && \
pm2 start 'npx tsx server/index.ts' \
--name aperant-web \
--cwd ${TOWER_APP_DIR} \
--env PORT=5181 && \
pm2 save"
echo ""
echo "✓ Deployed to https://${DOMAIN}"
echo " → API: https://${DOMAIN}/api/health"
echo " → PM2: ssh ${TOWER_HOST} 'pm2 logs aperant-web'"