修复(08-08-production-deployment-execution): 持久化远端部署阶段日志
ci-e2e / e2e (push) Canceled after 0s
ci-minimal / check-minimal (push) Canceled after 0s

这个提交包含在:
2026-08-08 21:29:55 +08:00
父节点 b94afcfab0
当前提交 0224ad83d7
共修改 6 个文件,包含 110 行新增和 3 行删除
@@ -96,6 +96,17 @@ describe("deployment safety contract", () => {
expect(wrapper).toContain("DEPLOY_STATUS_OUTPUT_MODE=quiet");
expect(deploy).toContain("DEPLOY_STATUS_OUTPUT_MODE");
expect(deploy).toContain("DEPLOY_STATUS_OUTPUT_MODE='${DEPLOY_STATUS_OUTPUT_MODE}'");
expect(deploy).toContain('DEPLOY_RUNTIME_LOG_REF="artifacts/deployment-runtime"');
expect(deploy).toContain('install -d -m 0700 "$DEPLOY_RUNTIME_LOG_DIR"');
expect(deploy).toContain('chmod 0600 "$log_file"');
expect(deploy).toContain('>"$log_file" 2>&1');
expect(deploy).toMatch(/if "\$@" <\/dev\/null >"\$log_file" 2>&1; then[\s\S]*else\s+local status=\$\?/u);
expect(deploy).toContain('run_logged_deploy_stage "build-init"');
expect(deploy).toContain('run_logged_deploy_stage "run-init"');
expect(deploy).toContain('run_logged_deploy_stage "build-switch-server"');
expect(deploy).not.toContain('\n"${compose_cmd[@]}" build init\n');
expect(deploy).not.toContain('\n"${compose_cmd[@]}" run --rm -T --entrypoint sh init');
expect(deploy).not.toContain('\n"${compose_cmd[@]}" "${profile_args[@]}" up -d --build server\n');
expect(wrapper).toContain("生产部署验证不接受未进入上游的提交");
expect(wrapper).toContain("部署后 migration status 与目标只读复核");
expect(wrapper).toContain('EXPECTED_PENDING_MIGRATIONS=""');