Files
CRM_Montzar/.cursor/rules/deploy.mdc
T
MahdiandCursor 1c1b77e74a Lock canonical npm deploy steps for production.
Prevent alternate package managers or ad-hoc deploy recipes in agent replies.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-05 18:04:12 +03:30

34 lines
1.2 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
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**.