From 5fbc175e540803d919863f3d90dffc3c0645a90b Mon Sep 17 00:00:00 2001 From: Tyler Hoang Date: Sat, 30 May 2026 00:21:03 -0700 Subject: feat: add scripts/deploy.sh for idempotent production deploys Handles first-time install (--install) and redeploys: pulls, builds backend and frontend as www-data with the required HOME/NPM_CONFIG_CACHE env, restarts systemd services, and smoke-checks /health and /. Co-Authored-By: Claude Opus 4.7 --- AGENTS.md | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'AGENTS.md') diff --git a/AGENTS.md b/AGENTS.md index ac36c80..fbb2f2a 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -29,14 +29,11 @@ cd frontend && npm run lint && npm run build Topology: uvicorn on `127.0.0.1:8001`, `next start` on `127.0.0.1:3001`, nginx TLS reverse-proxy (`/api/` → backend, `/` → frontend). See `README.md` for the full deploy and redeploy commands. Service user is `www-data`; code lives at `/var/www/prism-v2/`. -Redeploy in one shot: +Redeploy: ```bash -cd /var/www/prism-v2 && sudo -u www-data git pull origin master -sudo -u www-data backend/.venv/bin/pip install -r backend/requirements.txt -sudo -u www-data env HOME=/var/www/prism-v2/frontend NPM_CONFIG_CACHE=/var/www/prism-v2/frontend/.npm npm --prefix frontend ci -sudo -u www-data env HOME=/var/www/prism-v2/frontend NPM_CONFIG_CACHE=/var/www/prism-v2/frontend/.npm npm --prefix frontend run build -sudo systemctl restart prismv2-backend.service prismv2-frontend.service +cd /var/www/prism-v2 && sudo ./scripts/deploy.sh +# --no-pull to skip git pull; --install to also refresh systemd units + nginx site ``` ## Coding Style -- cgit v1.3-2-g0d8e