docs: record 2026-09-12 production deployment (49a916b)
This commit is contained in:
parent
49a916bbf4
commit
bbc7622d1b
@ -1,7 +1,7 @@
|
||||
# 部署说明(DEPLOYMENT)
|
||||
|
||||
日期:2026-09-10 · 测试机 `192.168.199.22`(Ubuntu 24.04,LAN)
|
||||
当前上线版本:**`8657f44`**(API 修复);Web/CMS 代码内容与 `p4` 相同,随发布一并指向 `8657f44`。
|
||||
当前上线版本:**`49a916b`**(www + CMS,详见 `production-deployment-2026-09-12.md`);API 仍为 `ad87a71`。
|
||||
|
||||
## 1. 部署模型
|
||||
|
||||
|
||||
31
docs/production-deployment-2026-09-12.md
Normal file
31
docs/production-deployment-2026-09-12.md
Normal file
@ -0,0 +1,31 @@
|
||||
# 生产部署记录(2026-09-12)
|
||||
|
||||
## 发布
|
||||
|
||||
- 发布提交:`49a916b`(首页菜单增加"主页"入口;全站按钮改为透明底 + hover 动态背景,按钮内文字前加品牌 logo 小图标 `components/brand-icon.tsx`;CMS 中文化标签、i18n(en/zh)、自定义退出按钮 `/cms/api/cms-logout`)。
|
||||
- 发布目录:`/home/flym/releases/49a916b-www`(www,服务器构建)、`/home/flym/releases/cms-49a916b`(CMS,服务器构建)。
|
||||
- 软链:`kaotings-www`→`releases/49a916b-www`、`kaotings-cms`→`releases/cms-49a916b`、`kaotings-api`→`releases/ad87a71/services/api`(未变更,未重启)。
|
||||
- 数据库迁移:无(CMS 改动仅为标签/i18n/组件,无字段结构变化)。
|
||||
|
||||
## 过程
|
||||
|
||||
1. 本地提交 `49a916b` 并推送 origin(`57c854a..49a916b`)。
|
||||
2. `git archive` 打包 www 全量与 `apps/cms`,scp 上传(`kaotings_deploy` 密钥)。
|
||||
3. 服务器 `cp -a` 上一发布后解包覆盖;关键文件 SHA256 与本地一致(`lib/content.ts`、`brand-icon.tsx`、`payload.config.ts`)。
|
||||
4. 服务器构建:www(`NODE_ENV=production CMS_PUBLIC_API_URL=http://127.0.0.1:3001/cms npm run build`)与 CMS(`npm run build`)均成功。
|
||||
5. CMS 产物完整性:`.next/node_modules` 经符号链接实文件 319 个(pino 207),符合"服务器构建"要求,无 09-11 的 Windows 构建空目录问题。
|
||||
6. 切换顺序:先 CMS(重启 `kaotings-cms`,验证 200)→ 再 www(重启 `kaotings-web`)。软链属主为 flym,切换本身无需 sudo;仅 `systemctl restart` 使用 sudo。
|
||||
|
||||
## 回滚
|
||||
|
||||
- www 回滚:`kaotings-www`→`releases/ad87a71-www` + `systemctl restart kaotings-web`。
|
||||
- CMS 回滚:`kaotings-cms`→`releases/cms-ad87a71-c` + `systemctl restart kaotings-cms`。
|
||||
- 无迁移,回滚无数据兼容问题。
|
||||
|
||||
## 验收
|
||||
|
||||
- `systemctl is-active`:kaotings-api / kaotings-cms / kaotings-web 均 active。
|
||||
- `GET /healthz`(127.0.0.1:8000 与 https://www.kaotings.com):ok / 200。
|
||||
- www 首页(本地 3000 与外部 https 一致):主导航含"主页"(→`/`);登录/联系我们为统一透明底按钮(hover 出背景);页面 `/_next/image` 图标 18 处(含按钮 logo 与品牌标);`/icon.png` 200。
|
||||
- CMS:`/cms/admin` 200;`/cms/api/products?where[status][equals]=published` 200(www 产品列表依赖正常)。
|
||||
- 管理端中文标签/i18n 与退出按钮:代码已上线,登录态界面待人工目视确认。
|
||||
Loading…
Reference in New Issue
Block a user