fix: connect client development proxy to overseas gateway
This commit is contained in:
@@ -7,10 +7,15 @@ services:
|
|||||||
- "127.0.0.1:9002:80"
|
- "127.0.0.1:9002:80"
|
||||||
environment:
|
environment:
|
||||||
API_UPSTREAM: "http://firstleg-development-gateway:9000"
|
API_UPSTREAM: "http://firstleg-development-gateway:9000"
|
||||||
|
OVERSEAS_API_UPSTREAM: "http://firstleg-development-gateway-overseas:9300"
|
||||||
networks:
|
networks:
|
||||||
- development-backend
|
- development-backend
|
||||||
|
- development-overseas-backend
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
development-backend:
|
development-backend:
|
||||||
external: true
|
external: true
|
||||||
name: firstleg-development-network
|
name: firstleg-development-network
|
||||||
|
development-overseas-backend:
|
||||||
|
external: true
|
||||||
|
name: firstleg-development-overseas-network
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import test from 'node:test'
|
|||||||
|
|
||||||
const config = readFileSync(new URL('../../nginx/default.conf.template', import.meta.url), 'utf8')
|
const config = readFileSync(new URL('../../nginx/default.conf.template', import.meta.url), 'utf8')
|
||||||
const testCompose = readFileSync(new URL('../../docker-compose.test.yml', import.meta.url), 'utf8')
|
const testCompose = readFileSync(new URL('../../docker-compose.test.yml', import.meta.url), 'utf8')
|
||||||
|
const developmentCompose = readFileSync(new URL('../../docker-compose.development.yml', import.meta.url), 'utf8')
|
||||||
const jenkinsfile = readFileSync(new URL('../../Jenkinsfile', import.meta.url), 'utf8')
|
const jenkinsfile = readFileSync(new URL('../../Jenkinsfile', import.meta.url), 'utf8')
|
||||||
const dockerfile = readFileSync(new URL('../../Dockerfile', import.meta.url), 'utf8')
|
const dockerfile = readFileSync(new URL('../../Dockerfile', import.meta.url), 'utf8')
|
||||||
|
|
||||||
@@ -22,6 +23,15 @@ test('routes domestic and overseas browser APIs to their test gateways without d
|
|||||||
assert.doesNotMatch(config, /\/api\/api/)
|
assert.doesNotMatch(config, /\/api\/api/)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
test('connects the development client proxy to both development gateways', () => {
|
||||||
|
assert.match(developmentCompose, /API_UPSTREAM: "http:\/\/firstleg-development-gateway:9000"/)
|
||||||
|
assert.match(developmentCompose, /OVERSEAS_API_UPSTREAM: "http:\/\/firstleg-development-gateway-overseas:9300"/)
|
||||||
|
assert.match(developmentCompose, /- development-backend/)
|
||||||
|
assert.match(developmentCompose, /- development-overseas-backend/)
|
||||||
|
assert.match(developmentCompose, /development-overseas-backend:[\s\S]*?external: true[\s\S]*?name: firstleg-development-overseas-network/)
|
||||||
|
assert.doesNotMatch(developmentCompose, /test-api|prod(?:uction)?/i)
|
||||||
|
})
|
||||||
|
|
||||||
test('runs each deployment on its target node without controller-local SSH files', () => {
|
test('runs each deployment on its target node without controller-local SSH files', () => {
|
||||||
assert.match(jenkinsfile, /env\.JOB_BASE_NAME\?\.endsWith\('-dev'\) \? 'java-dev' : 'java-test'/)
|
assert.match(jenkinsfile, /env\.JOB_BASE_NAME\?\.endsWith\('-dev'\) \? 'java-dev' : 'java-test'/)
|
||||||
assert.match(jenkinsfile, /DEVELOPMENT_COMPOSE_PROJECT = 'client-web'/)
|
assert.match(jenkinsfile, /DEVELOPMENT_COMPOSE_PROJECT = 'client-web'/)
|
||||||
|
|||||||
Reference in New Issue
Block a user