ci: serialize registry-based environment deployments

This commit is contained in:
2026-08-22 11:01:06 +08:00
parent ff9c1e2bc1
commit ba8a6b7832
3 changed files with 37 additions and 6 deletions
@@ -30,12 +30,16 @@ test('production deployments cannot skip tests', () => {
assert.match(pipeline, /error\('生产环境禁止跳过测试'\)/)
})
test('Java builds use the shared builder pool and deploy on the target environment node', () => {
test('Java builds use the shared builder pool and serialize incremental target deployments', () => {
assert.match(pipeline, /agent \{ label 'java-builder' \}/)
assert.match(pipeline, /\['development', 'test'\]\.contains\(params\.ENVIRONMENT\)/)
assert.match(pipeline, /\['master', 'built-in'\]\.contains\(env\.NODE_NAME\)/)
assert.match(pipeline, /String deployLock = "firstleg-\$\{params\.ENVIRONMENT\}-deploy"/)
assert.match(pipeline, /lock\(resource: deployLock, inversePrecedence: true\)/)
assert.match(pipeline, /deploy-built-service\.sh/)
assert.match(directDeployScript, /docker save "\$IMAGE" \| gzip -1 \| run_ssh/)
assert.match(directDeployScript, /docker pull "\$IMAGE"/)
assert.match(directDeployScript, /run_ssh docker pull "\$IMAGE"/)
assert.doesNotMatch(directDeployScript, /docker save "\$IMAGE"/)
assert.match(directDeployScript, /--pull never/)
})