Fixed service-api-gateway add env Server port

This commit is contained in:
Duvan Rondon 2025-02-24 15:43:43 -05:00
parent 5b5eb0ac90
commit 42f46a5d06
2 changed files with 7 additions and 5 deletions

View File

@ -51,13 +51,13 @@ pipeline {
def outputSpring = sh(script: "gcloud run services replace service-spring.yml --platform=managed --region=${REGION} 2>&1", returnStdout: true).trim() def outputSpring = sh(script: "gcloud run services replace service-spring.yml --platform=managed --region=${REGION} 2>&1", returnStdout: true).trim()
def cloudRunUrlMatchNest = outputNest =~ /URL:\s+(https:\/\/[^\s]+)/ def cloudRunUrlMatchNest = outputNest =~ /URL:\s+(https:\/\/[^\s]+)/
def cloudRunUrlMatchSpring = outputSpring =~ /URL:\s+(https:\/\/[^\s]+)/ def cloudRunUrlMatchLotes = outputSpring =~ /URL:\s+(https:\/\/[^\s]+)/
if (cloudRunUrlMatchNest) { if (cloudRunUrlMatchNest) {
env.CLOUD_RUN_NEST = cloudRunUrlMatchNest[0][1] env.CLOUD_RUN_NEST = cloudRunUrlMatchNest[0][1]
} }
if (cloudRunUrlMatchSpring) { if (cloudRunUrlMatchSpring) {
env.CLOUD_RUN_SPRING = cloudRunUrlMatchSpring[0][1] env.CLOUD_RUN_LOTES = cloudRunUrlMatchLotes[0][1]
} }
} }
} }
@ -67,7 +67,7 @@ pipeline {
steps { steps {
sh ''' sh '''
sed -i "s|SERVICE_NEST_URL|${CLOUD_RUN_NEST}|g" **.yml sed -i "s|SERVICE_NEST_URL|${CLOUD_RUN_NEST}|g" **.yml
sed -i "s|SERVICE_SPRING_URL|${CLOUD_RUN_SPRING}|g" **.yml sed -i "s|SERVICE_LOTES_URL|${CLOUD_RUN_LOTES}|g" **.yml
cat service-api-gateway.yml cat service-api-gateway.yml
''' '''
} }

View File

@ -14,7 +14,7 @@ spec:
image: consiti/felsv-spring-cloud-api-gateway:Prueba4 image: consiti/felsv-spring-cloud-api-gateway:Prueba4
ports: ports:
- name: http1 - name: http1
containerPort: 8440 containerPort: 8082
resources: resources:
limits: limits:
cpu: 1000m cpu: 1000m
@ -24,10 +24,12 @@ spec:
periodSeconds: 240 periodSeconds: 240
failureThreshold: 1 failureThreshold: 1
tcpSocket: tcpSocket:
port: 8440 port: 8082
env: env:
- name: SERVICIO_LOTES - name: SERVICIO_LOTES
value: SERVICE_LOTES_URL value: SERVICE_LOTES_URL
- name: SERVICIO_NEST - name: SERVICIO_NEST
value: SERVICE_NEST_URL value: SERVICE_NEST_URL
- name: SERVER_PORT
value: '8082'