feat(ci): deploy both event bridge regions by default

This commit is contained in:
2026-08-24 17:19:36 +08:00
parent 3d8a1fac20
commit 5a4bcf130a
5 changed files with 69 additions and 19 deletions
@@ -40,3 +40,10 @@ test('coordinator cannot initialize test databases', () => {
assert.doesNotMatch(pipeline, /initialize-test-databases\.sh/)
assert.doesNotMatch(pipeline, /测试数据库初始化/)
})
test('coordinator defaults event bridge deployments to both non-production regions', () => {
assert.match(pipeline, /choice\(name: 'EVENT_BRIDGE_REGION', choices: \['BOTH', 'CN', 'OVERSEAS'\]/)
assert.match(pipeline, /\['BOTH', 'SELECT', 'CN', 'OVERSEAS'\]\.contains\(bridgeRegion\)/)
assert.match(pipeline, /兼容旧 Jenkins 参数 SELECT:本次按 BOTH/)
assert.match(pipeline, /事件桥 BOTH 仅支持开发或测试环境/)
})
@@ -19,10 +19,10 @@ test('Jenkins pipelines recognize all overseas deployable modules', async () =>
assert.match(service, /lastleg-service\/target\/lastleg-service-1\.0\.0-SNAPSHOT\.jar/)
assert.match(service, /warehouse-overseas-service\/target\/warehouse-overseas-service-1\.0\.0-SNAPSHOT\.jar/)
assert.match(controller, /EVENT_BRIDGE_REGION/)
assert.match(service, /EVENT_BRIDGE_REGION_OVERRIDE=\$\{params\.EVENT_BRIDGE_REGION\}/)
assert.match(controller, /choices: \['SELECT', 'CN', 'OVERSEAS'\]/)
assert.match(service, /choices: \['SELECT', 'CN', 'OVERSEAS'\]/)
assert.match(controller, /部署 event-bridge-service 必须明确选择 EVENT_BRIDGE_REGION=CN 或 OVERSEAS/)
assert.match(service, /EVENT_BRIDGE_REGION_OVERRIDE=\$\{bridgeRegion\}/)
assert.match(controller, /choices: \['BOTH', 'CN', 'OVERSEAS'\]/)
assert.match(service, /choices: \['BOTH', 'CN', 'OVERSEAS'\]/)
assert.match(controller, /事件桥 BOTH 仅支持开发或测试环境/)
})
test('service map freezes unique internal ports and moves event bridge away from 9300', async () => {
@@ -48,6 +48,11 @@ test('overseas compose is isolated from CN defaults and disables implicit schema
assert.match(compose, /^ warehouse-overseas-service:\s*$/m)
assert.match(compose, /^ event-bridge-service:\s*$/m)
assert.match(compose, /EVENT_BRIDGE_OVERSEAS_PORT:-9313}:9312/)
assert.match(compose, /INTERNAL_SERVICE_TOKEN: \$\{INTERNAL_SERVICE_TOKEN\}/)
assert.match(compose, /LASTLEG_DB_URL: \$\{LASTLEG_DB_URL\}/)
assert.match(compose, /EVENT_BRIDGE_DB_URL: \$\{EVENT_BRIDGE_OVERSEAS_DB_URL\}/)
assert.match(compose, /EVENT_BRIDGE_DB_USERNAME: \$\{EVENT_BRIDGE_OVERSEAS_DB_USERNAME\}/)
assert.match(compose, /EVENT_BRIDGE_DB_PASSWORD: \$\{EVENT_BRIDGE_OVERSEAS_DB_PASSWORD\}/)
})
test('CN and overseas event bridges have explicit opposite-region consumers', async () => {
@@ -155,3 +155,12 @@ test('direct deployments wait for health and automatically restore the previous
assert.match(directDeployScript, /自动回滚失败/)
assert.match(directDeployScript, /return 1/)
})
test('one event bridge build deploys both regional instances in development and test', () => {
assert.match(pipeline, /choice\(name: 'EVENT_BRIDGE_REGION', choices: \['BOTH', 'CN', 'OVERSEAS'\]/)
assert.match(pipeline, /\['BOTH', 'SELECT'\]\.contains\(params\.EVENT_BRIDGE_REGION\)/)
assert.match(pipeline, /\? \['CN', 'OVERSEAS'\]/)
assert.match(pipeline, /bridgeRegions\.each \{ bridgeRegion ->/)
assert.match(pipeline, /EVENT_BRIDGE_REGION_OVERRIDE=\$\{bridgeRegion\}/)
assert.match(pipeline, /部署事件桥实例:/)
})