Files
full/wiki/operations.md
2026-08-10 11:42:45 +08:00

46 lines
1.3 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.
# 开发与运维
## 配置
配置路径规则为:
<BSM_Prefix>/etc/<serviceKey>_<BSM_RuntimeMode>.yaml
all 的 serviceKey 来自 --workspace默认 default。BSM_RuntimeMode 默认 devBSM_SERVICES 可覆盖聚合服务列表。
## 验证
Windows
./scripts/verify-workspace.ps1
Linux/macOS
./scripts/verify-workspace.sh
脚本对每个 module 执行 go vet 和 go test并检查 gofmt。依赖真实服务的测试应使用 integration tag。
## 构建
scripts/build-all-linux.sh 构建 module 下独立服务到 .builds。all 可单独构建:
cd all
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -trimpath -o ../.builds/all ./cmd/main
## 发布检查
1. workspace 验证通过。
2. git diff --check 通过。
3. 配置不存在 CHANGE_ME。
4. 数据库迁移已在预发布验证。
5. Services 仅包含计划发布服务。
6. TLS、访问控制、日志脱敏和监控已配置。
7. 已准备二进制及数据库回滚方案。
## 排障
- 配置不存在检查工作目录、BSM_Prefix、BSM_RuntimeMode 和 workspace 文件名。
- 服务未注册:检查 Services 与 BSM_SERVICES。
- 启动失败检查端口、DSN、Redis、etcd 和迁移权限。
- gateway 404确认 proto gateway 注册Gin 只在 gateway 404 后接管。