2026-05-27 09:39:05 +08:00
|
|
|
|
# scripts 目录说明
|
|
|
|
|
|
|
|
|
|
|
|
日期:2026-05-27
|
|
|
|
|
|
|
|
|
|
|
|
`scripts/` 当前按职责拆成三层,避免部署、验收和回归入口继续平铺混杂。
|
|
|
|
|
|
|
|
|
|
|
|
## 目录划分
|
|
|
|
|
|
|
|
|
|
|
|
- `scripts/deploy/`
|
|
|
|
|
|
- 部署、构建、远端环境拉起
|
|
|
|
|
|
- 例如:
|
|
|
|
|
|
- `build_local_image.sh`
|
|
|
|
|
|
- `deploy_tksea_portal.sh`
|
|
|
|
|
|
- `setup_remote43_patched_stack.sh`
|
2026-05-28 10:13:13 +08:00
|
|
|
|
- 其中 `setup_remote43_patched_stack.sh` 现会同时准备 remote43 上固定的 Git checkout 路径:
|
|
|
|
|
|
- `/home/ubuntu/sub2api-cn-relay-manager-git-current`
|
|
|
|
|
|
- 供 CRM `SUB2API_CRM_REPO_ROOT` 与 provider 草稿发布链共用
|
2026-05-27 09:39:05 +08:00
|
|
|
|
- `scripts/acceptance/`
|
|
|
|
|
|
- 真实宿主验收、upstream 直探、artifact 安全化
|
|
|
|
|
|
- 例如:
|
|
|
|
|
|
- `real_host_acceptance.sh`
|
|
|
|
|
|
- `import_remote43_provider.sh`
|
|
|
|
|
|
- `check_deepseek_completion_split.sh`
|
|
|
|
|
|
- `scripts/test/`
|
|
|
|
|
|
- 脚本自身的回归与资产检查
|
|
|
|
|
|
- 例如:
|
|
|
|
|
|
- `test_real_host_scripts.sh`
|
|
|
|
|
|
- `test_tksea_portal_assets.sh`
|
2026-05-30 15:28:32 +08:00
|
|
|
|
- `verify_quality_gates.sh`
|
2026-05-27 09:39:05 +08:00
|
|
|
|
|
|
|
|
|
|
## 放置规则
|
|
|
|
|
|
|
|
|
|
|
|
- 新增脚本前先判断它属于 `deploy`、`acceptance` 还是 `test`
|
|
|
|
|
|
- 需要被目标机直接消费的静态文件不要放这里,应放到 `deploy/`
|
|
|
|
|
|
- 真实验收产物不要放这里,应落到 `artifacts/`
|
|
|
|
|
|
|
|
|
|
|
|
## 常用入口
|
|
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
|
bash ./scripts/test/test_real_host_scripts.sh
|
|
|
|
|
|
bash ./scripts/test/test_tksea_portal_assets.sh
|
2026-05-30 15:28:32 +08:00
|
|
|
|
bash ./scripts/test/verify_quality_gates.sh
|
2026-05-27 09:39:05 +08:00
|
|
|
|
scripts/deploy/build_local_image.sh
|
|
|
|
|
|
bash ./scripts/acceptance/real_host_acceptance.sh
|
|
|
|
|
|
```
|
2026-05-30 15:28:32 +08:00
|
|
|
|
|
|
|
|
|
|
## 统一质量门禁
|
|
|
|
|
|
|
|
|
|
|
|
`scripts/test/verify_quality_gates.sh` 是当前推荐的一键测试入口,职责是:
|
|
|
|
|
|
|
|
|
|
|
|
- 统一执行:
|
|
|
|
|
|
- `gofmt -l .`
|
|
|
|
|
|
- `go vet ./...`
|
|
|
|
|
|
- `go test -cover ./internal/...`
|
|
|
|
|
|
- `go test ./tests/integration/... -count=1`
|
|
|
|
|
|
- 读取 `tests/quality/coverage_thresholds.tsv`
|
|
|
|
|
|
- 输出 coverage gate 报告到临时目录
|
|
|
|
|
|
- 对 core 包覆盖率做硬门槛,对 watch 包做显式告警
|