001project_wildgrowth/backend/deploy/README.md

42 lines
1.2 KiB
Markdown
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.

# 部署脚本说明
**部署入口与完整流程见项目根 `DEPLOY_QUICK.md`。** 本文只说明本目录脚本。
---
## 脚本一览
| 脚本 | 用途 |
|------|------|
| **deploy-from-github.sh** | 日常部署与回滚(唯一正式入口) |
| **scripts/server-cleanup-safe.sh** | 服务器安全清理冗余、logs、pm2、npm 缓存) |
| **scripts/migration-fix-and-start.sh** | 仅当 `prisma migrate deploy` 报 P3015 且服务未起时,一次性修复并启动 |
| **check-database.sh** | 数据库连通检查 |
| **setup-ssl-api.sh** / **update-nginx-ssl.sh** | SSL / Nginx 一次性配置 |
| **setup-apple-secret.sh** | Apple IAP 等密钥配置 |
---
## 日常部署(摘要)
```bash
cd /var/www/wildgrowth-backend/backend
bash deploy/deploy-from-github.sh # 部署
bash deploy/deploy-from-github.sh rollback # 回滚
```
---
## ⚠️ 复盘与教训
| 文档 | 说明 |
|------|------|
| **POSTMORTEM_ENV_OVERWRITE.md** | `.env` 被覆盖导致服务中断的复盘(**必读** |
---
## 更多
- **目录约定、首次搭建、手动部署、常见场景**:见项目根 **`DEPLOY_QUICK.md`**
- **清理项说明**:见 **`SERVER_CLEANUP.md`**