fix(deploy): support isolated temporary production release

This commit is contained in:
2026-10-07 11:09:41 +08:00
parent 899978e53d
commit ca7f6aa414
5 changed files with 132 additions and 9 deletions
+14 -5
View File
@@ -27,13 +27,12 @@ test('test deployment requires an explicit shared network, Gateway and version',
assert.match(compose, /external: true/)
assert.match(compose, /127\.0\.0\.1:/)
assert.doesNotMatch(compose, /overseas|host\.docker\.internal|production|development/)
assert.match(jenkins, /label 'java-test'/)
assert.match(jenkins, /'java-builder' : 'java-test'/)
assert.match(jenkins, /docker compose -f docker-compose\.test\.yml config --quiet/)
assert.match(jenkins, /docker network inspect/)
assert.doesNotMatch(jenkins, /docker-compose\.(production|development)|deploy-production|sshUserPrivateKey/)
for (const file of ['docker-compose.production.yml', 'docker-compose.development.yml', 'scripts/deploy-production.sh']) {
assert.equal(existsSync(resolve(root, file)), false)
}
assert.match(jenkins, /scripts\/deploy-production\.sh/)
assert.match(jenkins, /firstleg-production-ssh/)
})
test('application shell is revalidated and missing chunks remain 404', () => {
@@ -65,3 +64,13 @@ test('container build excludes local environment values and waits for Nginx heal
assert.match(compose, /http:\/\/127\.0\.0\.1\/healthz/)
assert.match(jenkins, /up -d --wait --wait-timeout 120/)
})
test('gray production is isolated from TEST and routes to the single Gateway', () => {
const production = readFileSync(resolve(root, 'docker-compose.production.yml'), 'utf8')
assert.match(production, /name: firstleg-production-network/)
assert.match(production, /API_UPSTREAM: "http:\/\/gateway:9000"/)
assert.match(production, /127\.0\.0\.1:/)
assert.match(production, /healthcheck:/)
assert.doesNotMatch(production, /test-network|gateway-overseas|gateway-active|routing-network/)
assert.doesNotMatch(jenkins, /wecom|sendProductionWeComNotification/)
})