Files

34 lines
1.2 KiB
Plaintext
Raw Permalink Normal View History

---
description: Canonical production deploy for crm.montzar.ir — always use npm, never invent alternate commands
alwaysApply: true
---
# Deploy (locked)
Source of truth: [`deploy/DEPLOY.md`](deploy/DEPLOY.md).
When giving deploy / update steps after a push, paste **exactly** this block (or the matching section in that file). Do not invent variants.
```bash
ssh -p 3031 montime@185.50.38.53
cd /var/www/crm
git pull
npm run build -w @mento/shared
cd apps/api && npx prisma migrate deploy && npx prisma generate && cd ../..
npm run build -w @mento/api
npm run build -w @mento/web
pm2 restart mento-crm-api
# only if STT deps changed:
# pm2 restart mento-stt
```
## Hard rules
- Package manager is **npm workspaces** (`npm run … -w @mento/…`). **Never** suggest `pnpm` or `yarn`.
- Prisma: always from `apps/api` (needs `apps/api/.env`). Never `prisma migrate` from repo root.
- Build order: `shared` → migrate/generate → `api` → `web` → `pm2 restart mento-crm-api`.
- Host: `185.50.38.53`, SSH port `3031`, user `montime`, path `/var/www/crm`, PM2 `mento-crm-api`.
- Do not touch other apps’ ports/PM2 names on that server.
- If deploy docs and chat history disagree, **DEPLOY.md + this rule win**.