Files
movie-select/deploy.sh
Felix Förtsch 265cd329f6 refactor to react/vite/hono/drizzle/postgresql stack
replace vanilla TS + Bun.serve() + MariaDB with:
- frontend: React 19, Vite 6, TanStack Router/Query, Tailwind v4
- backend: Hono + @hono/node-server, Drizzle ORM, PostgreSQL, Zod
- shared: algorithm, round-state, types in src/shared/
- tooling: Biome (lint/format), Vitest (tests)
- deploy: static files at /movie-select/, API at /movie-select/api

URL scheme changes from /movies/ to /movie-select/,
API from action-based to RESTful endpoints.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 15:03:35 +01:00

48 lines
1.4 KiB
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
REMOTE_HOST="serve"
REMOTE_APP_DIR="/home/serve/services/movie-select"
REMOTE_STATIC_DIR="/var/www/virtual/serve/html/movie-select"
echo "==> Installing local dependencies..."
bun install
echo "==> Building client (Vite)..."
bun run build
echo "==> Syncing static files to ${REMOTE_HOST}:${REMOTE_STATIC_DIR} ..."
rsync -avz --delete \
--exclude='.DS_Store' \
dist/client/ "${REMOTE_HOST}:${REMOTE_STATIC_DIR}/"
echo "==> Copying .htaccess for SPA fallback..."
scp .htaccess "${REMOTE_HOST}:${REMOTE_STATIC_DIR}/.htaccess"
echo "==> Syncing server code to ${REMOTE_HOST}:${REMOTE_APP_DIR} ..."
rsync -avz --delete \
--exclude='.DS_Store' \
--exclude='.git/' \
--exclude='.env' \
--exclude='.env.example' \
--exclude='dist/' \
--exclude='tests/' \
--exclude='scripts/' \
--exclude='drizzle/' \
--exclude='node_modules/' \
--exclude='.htaccess' \
--exclude='AI_AGENT_REPORT.md' \
--exclude='*.test.ts' \
--exclude='vite.config.ts' \
--exclude='drizzle.config.ts' \
--exclude='biome.json' \
./ "${REMOTE_HOST}:${REMOTE_APP_DIR}/"
echo "==> Installing production dependencies on remote..."
ssh "${REMOTE_HOST}" "cd ${REMOTE_APP_DIR} && npm install --omit=dev"
echo "==> Restarting service..."
ssh "${REMOTE_HOST}" "systemctl --user restart movie-select 2>/dev/null || true"
echo "Done. Live at https://serve.uber.space/movie-select/"