feat(ci): 新增发布与灰度部署脚本 #316

Merged
xiaoxia merged 1 commits from feat/release-scripts-clean into develop 2026-07-14 13:12:41 +08:00
Owner

变更内容

新增3个生产环境适配的发布脚本:

scripts/release.sh

一键发布脚本:打 tag → 触发 CI 构建 → 提示灰度操作

scripts/gray_deploy.sh

灰度发布脚本:

  • 拉取新版本镜像
  • 启动 API + Web canary 容器(端口错开:18001/13002)
  • 等待健康检查通过
  • 自动修改 Nginx upstream 权重切流
  • 配置备份 + nginx -t 校验

scripts/rollback_gray.sh

灰度回滚脚本:

  • 从备份恢复 Nginx 配置
  • 全量切回稳定版本
  • Canary 容器30分钟后自动清理

灰度范围

  • API(saas-api.xiaoxiajianji.com):Nginx upstream 权重
  • Web(saas.xiaoxiajianji.com):Nginx upstream 权重
  • Worker:队列消费模型无法按比例切流,暂全量升级

验证方式

  1. 脚本仅修改 scripts/ 目录,不影响业务代码
  2. 三门禁 CI 验证通过
  3. 生产验证在下个版本发布时执行
## 变更内容 新增3个生产环境适配的发布脚本: ### scripts/release.sh 一键发布脚本:打 tag → 触发 CI 构建 → 提示灰度操作 ### scripts/gray_deploy.sh 灰度发布脚本: - 拉取新版本镜像 - 启动 API + Web canary 容器(端口错开:18001/13002) - 等待健康检查通过 - 自动修改 Nginx upstream 权重切流 - 配置备份 + nginx -t 校验 ### scripts/rollback_gray.sh 灰度回滚脚本: - 从备份恢复 Nginx 配置 - 全量切回稳定版本 - Canary 容器30分钟后自动清理 ## 灰度范围 - ✅ API(saas-api.xiaoxiajianji.com):Nginx upstream 权重 - ✅ Web(saas.xiaoxiajianji.com):Nginx upstream 权重 - ❌ Worker:队列消费模型无法按比例切流,暂全量升级 ## 验证方式 1. 脚本仅修改 scripts/ 目录,不影响业务代码 2. 三门禁 CI 验证通过 3. 生产验证在下个版本发布时执行
xiaoxia added 1 commit 2026-07-14 13:09:47 +08:00
feat(ci): 新增发布与灰度部署脚本
CI/CD Pipeline / Validate Code Quality And Tests (pull_request) Successful in 39s
CI/CD Pipeline / Unit Tests (pull_request) Successful in 1m12s
CI/CD Pipeline / Frontend Lint (pull_request) Successful in 1m51s
CI/CD Pipeline / Build & Push Staging (Watchtower auto-deploy) (pull_request) Has been skipped
CI/CD Pipeline / Build Production Runtime Images (pull_request) Has been skipped
CI/CD Pipeline / Staging E2E Tests (pull_request) Has been skipped
CI/CD Pipeline / Staging API Integration Tests (pull_request) Has been skipped
CI/CD Pipeline / Deploy Production (pull_request) Has been skipped
CI/CD Pipeline / Production Browser E2E (pull_request) Has been skipped
CI/CD Pipeline / Integration Tests (pull_request) Successful in 1m25s
34336b2907
- release.sh: 一键发布脚本(打tag + 触发CI构建 + 灰度提示)
- gray_deploy.sh: 灰度发布脚本(canary容器 + nginx权重切流)
- rollback_gray.sh: 灰度回滚脚本(nginx回滚 + canary清理)
- 更新 rollback.sh 占位符为生产环境适配版

灰度范围:API + Web(Nginx upstream 权重)
Worker 暂不支持灰度(队列消费无法按比例切流)
xiaoxia merged commit def6ee2363 into develop 2026-07-14 13:12:41 +08:00
Sign in to join this conversation.