ci: 收口生产 main 分支部署流程

This commit is contained in:
2026-09-17 11:49:00 +08:00
parent bf8256a817
commit cd16687d25
7 changed files with 62 additions and 36 deletions
@@ -76,6 +76,9 @@ test('production deployments cannot skip tests', () => {
assert.match(coordinatorPipeline, /env\.RESOLVED_ENVIRONMENT == 'production' && params\.SKIP_TESTS/)
assert.match(coordinatorPipeline, /error\('生产环境禁止跳过测试'\)/)
assert.match(pipeline, /生产环境手工构建禁止跳过测试/)
assert.match(coordinatorPipeline, /refs\/heads\/main:refs\/remotes\/origin\/main/)
assert.match(coordinatorPipeline, /test "\$\(git rev-parse HEAD\)" = "\$\(git rev-parse origin\/main\)"/)
assert.match(pipeline, /git merge-base --is-ancestor "\$\{RESOLVED_SOURCE_COMMIT\}" origin\/main/)
})
test('Java builds use the shared builder pool and serialize incremental target deployments', () => {
@@ -86,7 +89,9 @@ test('Java builds use the shared builder pool and serialize incremental target d
assert.match(pipeline, /String deploySlotLabel = "firstleg-\$\{env\.RESOLVED_ENVIRONMENT\}-deploy-slot"/)
assert.match(pipeline, /lock\(label: deploySlotLabel, quantity: 1, inversePrecedence: true\)/)
assert.match(pipeline, /deploy-built-service\.sh/)
assert.doesNotMatch(pipeline, /dev_deploy|test_deploy|TARGET_SSH_KEY/)
assert.doesNotMatch(pipeline, /dev_deploy|test_deploy/)
assert.match(pipeline, /firstleg-production-ssh/)
assert.match(pipeline, /TARGET_SSH_KEY/)
assert.match(directDeployScript, /docker pull "\$IMAGE"/)
assert.match(directDeployScript, /run_ssh docker pull "\$IMAGE"/)
assert.doesNotMatch(directDeployScript, /docker save "\$IMAGE"/)
@@ -195,12 +200,12 @@ test('shared builders use a reachable public Maven mirror instead of the retired
assert.doesNotMatch(ciMavenSettings, /:18081/)
})
test('Java service images use the internal registry base image by default', () => {
const internalBaseImage = '172.31.198.7:10082/java-project/eclipse-temurin:17-jre-alpine'
test('Java service images use the canonical Gitea registry base image by default', () => {
const internalBaseImage = 'git.buggoglobal.com/java-project/eclipse-temurin:17-jre-alpine'
assert.match(coordinatorPipeline, new RegExp(internalBaseImage.replaceAll('.', '\\.')))
assert.match(pipeline, new RegExp(internalBaseImage.replaceAll('.', '\\.')))
assert.match(serviceDockerfile, new RegExp(internalBaseImage.replaceAll('.', '\\.')))
assert.match(serviceDockerfile, /ARG BASE_IMAGE/)
assert.doesNotMatch(coordinatorPipeline, /docker\.m\.daocloud\.io\/library\/eclipse-temurin/)
assert.doesNotMatch(pipeline, /docker\.m\.daocloud\.io\/library\/eclipse-temurin/)
assert.doesNotMatch(serviceDockerfile, /docker\.m\.daocloud\.io\/library\/eclipse-temurin/)