Files
cmautobuy/docs/task/279-admin部署档口入库码t0修复到生产.md
T
2026-08-19 11:35:41 +08:00

61 lines
3.1 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.
# 279 Admin:部署档口入库码 t=0 修复到生产
- 类型:部署
- 父级大工单:#14
- 所属 MVP / 版本:#15 / Admin 生产部署
- 状态:已完成,待用户验收
- 日期:2026-08-19
- Gitea 工单:http://ilaer.eicp.net:8418/chengma/cmautobuy/issues/279
## 背景与目标
将 #278 的 `updateDetailCode t=0` 修复发布到生产 Admin,继续通过
`https://buy.833729.com` 提供服务。
## 最终方案
- 从固定提交 `1cf0995` 建立隔离 worktree,以 Go 1.23.0 构建 Linux amd64 静态二进制,
SHA-256 为 `5567bf953ee39dec27727d96ff94a8fd92955816fe38fb732ae99516009cbd85`。
- 切换前确认档口入库码、AI 匹配和顺运宝同步活动任务均为 0;独立端口 `18081` 预检
登录页为 200、根路径为 303,生产 schema 为 v29。
- MySQL 业务账号按既有兼容方式使用 `mysqldump --no-tablespaces` 创建完整逻辑备份
并通过 gzip 校验。
- 发布到 `/opt/cmautobuy/releases/1cf0995/`,复用 release 外的配置和数据链接;停止
systemd 后原子切换 `/opt/cmautobuy/cmautobuy-admin`,启动失败或健康检查失败会切回
`cb7719c`。
- 没有执行重新匹配、排队或回写档口入库码,也没有触发 SYB 同步、AI、采集、采购、下单或付款。
## 改了哪些
- `/opt/cmautobuy/releases/1cf0995/cmautobuy-admin`:新增并启用生产二进制。
- `/opt/cmautobuy/cmautobuy-admin`:稳定链接从 `cb7719c` 原子切换到 `1cf0995`。
- `/opt/cmautobuy/backups/autobuy-before-279-20260819T033501Z-notablespaces.sql.gz`:生产逻辑备份,
5,458,289 字节,SHA-256 为 `c4f66614b7dc8c97a50fb5df19351be90e9916d65b3fbf63c8b6d6b29ae83976`。
## 验收结果
| 验收标准 | 结果 |
|---|---|
| 发布物来自固定提交,构建、上传和安装 SHA-256 一致 | 通过 |
| 切换前后台作业为空,逻辑备份可通过 gzip 校验 | 通过 |
| 独立端口预检和 schema v29 自检通过 | 通过 |
| systemd active/enabled,稳定链接指向新 release | 通过 |
| Nginx、本机登录页及公网 HTTPS 根路径、登录页、静态资源正常 | 通过 |
| 生产配置、数据和密钥未复制或输出;未触发业务写入 | 通过 |
| 上一 release `cb7719c` 保留,可切回 | 通过 |
## 测试
- 执行的命令:隔离 worktree 中以 `GOTOOLCHAIN=go1.23.0` 执行 `go test ./... -count=1`、
`go build ./...`、`go vet ./...`;`GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -trimpath -ldflags='-s -w'`;
服务器 SHA-256、独立端口预检、MySQL schema/活动任务查询、`mysqldump --no-tablespaces`、`gzip -t`、
`systemctl`、`ss`、`nginx -t`;本机公网 HTTPS 检查。
- 结果:服务运行 release `1cf0995`,PID `18568`,启动时间 `2026-08-19 11:35:02 CST`;
登录页本机及公网均为 200;根路径 303、静态资源 200;schema v29;活动任务均为 0。
- **没验证到的部分**:未登录生产页面重新勾选 19 号失败记录做真实回写;未实际执行回退或恢复备份。
## 相关提交
- `417cd73` fix: 回写档口入库码时 t 固定为 0 (#278)
- `1cf0995` docs: 归档任务 #278(本次生产目标代码基线)