audit and harden workspace
This commit is contained in:
45
wiki/operations.md
Normal file
45
wiki/operations.md
Normal file
@@ -0,0 +1,45 @@
|
||||
# 开发与运维
|
||||
|
||||
## 配置
|
||||
|
||||
配置路径规则为:
|
||||
|
||||
<BSM_Prefix>/etc/<serviceKey>_<BSM_RuntimeMode>.yaml
|
||||
|
||||
all 的 serviceKey 来自 --workspace,默认 default。BSM_RuntimeMode 默认 dev,BSM_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 后接管。
|
||||
Reference in New Issue
Block a user