Fixed service-nest.yml
This commit is contained in:
parent
6a13eb31e0
commit
5a2ee2b43e
|
@ -19,25 +19,18 @@ pipeline {
|
|||
|
||||
stage('Authenticate') {
|
||||
steps {
|
||||
sh '''
|
||||
gcloud auth activate-service-account --key-file="$GCLOUD_CREDS"
|
||||
'''
|
||||
sh 'gcloud auth activate-service-account --key-file="$GCLOUD_CREDS"'
|
||||
}
|
||||
}
|
||||
|
||||
stage('Deploy to Cloud Run Firmador') {
|
||||
steps {
|
||||
script {
|
||||
// Ejecuta el comando capturando stdout + stderr
|
||||
def output = sh(script: "gcloud run services replace service-firmador.yml --platform=managed --region=${REGION} 2>&1", returnStdout: true).trim()
|
||||
|
||||
// Busca la URL en la salida usando expresión regular
|
||||
def cloudRunUrlMatch = output =~ /URL:\s+(https:\/\/[^\s]+)/
|
||||
|
||||
if (cloudRunUrlMatch) {
|
||||
def cloudRunUrl = cloudRunUrlMatch[0][1] // Captura la URL
|
||||
env.CLOUD_RUN_FIRMADOR = cloudRunUrl
|
||||
}
|
||||
env.CLOUD_RUN_FIRMADOR = cloudRunUrlMatch[0][1]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -45,8 +38,8 @@ pipeline {
|
|||
stage('Envs about Firmador') {
|
||||
steps {
|
||||
sh '''
|
||||
sed -i "s|SERVICE_FIRMADOR_URL|${CLOUD_RUN_FIRMADOR}|g" **.yml
|
||||
cat service-nest.yml
|
||||
sed -i "s|SERVICE_FIRMADOR_URL|${CLOUD_RUN_FIRMADOR}|g" **.yml
|
||||
cat service-nest.yml
|
||||
'''
|
||||
}
|
||||
}
|
||||
|
@ -54,25 +47,36 @@ pipeline {
|
|||
stage('Deploy to Cloud Run Nest and Spring') {
|
||||
steps {
|
||||
script {
|
||||
// Ejecuta el comando capturando stdout + stderr
|
||||
def output = sh(script: "gcloud run services replace service-firmador.yml --platform=managed --region=${REGION} 2>&1", returnStdout: true).trim()
|
||||
def outputNest = sh(script: "gcloud run services replace service-nest.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()
|
||||
|
||||
// Busca la URL en la salida usando expresión regular
|
||||
def cloudRunUrlMatch = output =~ /URL:\s+(https:\/\/[^\s]+)/
|
||||
|
||||
if (cloudRunUrlMatch) {
|
||||
def cloudRunUrl = cloudRunUrlMatch[0][1] // Captura la URL
|
||||
env.CLOUD_RUN_FIRMADOR = cloudRunUrl
|
||||
}
|
||||
def cloudRunUrlMatchNest = outputNest =~ /URL:\s+(https:\/\/[^\s]+)/
|
||||
def cloudRunUrlMatchSpring = outputSpring =~ /URL:\s+(https:\/\/[^\s]+)/
|
||||
|
||||
if (cloudRunUrlMatchNest) {
|
||||
env.CLOUD_RUN_NEST = cloudRunUrlMatchNest[0][1]
|
||||
}
|
||||
if (cloudRunUrlMatchSpring) {
|
||||
env.CLOUD_RUN_SPRING = cloudRunUrlMatchSpring[0][1]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('Envs about Firmador') {
|
||||
stage('Envs about Nest and Spring') {
|
||||
steps {
|
||||
sh '''
|
||||
sed -i "s|SERVICE_FIRMADOR_URL|${CLOUD_RUN_FIRMADOR}|g" **.yml
|
||||
cat service-nest.yml
|
||||
sed -i "s|SERVICE_NEST_URL|${CLOUD_RUN_NEST}|g" **.yml
|
||||
sed -i "s|SERVICE_SPRING_URL|${CLOUD_RUN_SPRING}|g" **.yml
|
||||
cat service-api-gateway.yml
|
||||
'''
|
||||
}
|
||||
}
|
||||
|
||||
stage('Deploy Api Gateway') {
|
||||
steps {
|
||||
sh '''
|
||||
gcloud run services replace service-api-gateway.yml --platform='managed' --region='us-central1'
|
||||
'''
|
||||
}
|
||||
}
|
||||
|
@ -80,7 +84,7 @@ pipeline {
|
|||
stage('Allow allUsers') {
|
||||
steps {
|
||||
sh '''
|
||||
gcloud run services add-iam-policy-binding cbii-apigateway-jenkins --region='us-central1' --member='allUsers' --role='roles/run.invoker'
|
||||
gcloud run services add-iam-policy-binding cbii-apigateway-jenkins --region='us-central1' --member='allUsers' --role='roles/run.invoker'
|
||||
'''
|
||||
}
|
||||
}
|
||||
|
|
|
@ -103,10 +103,10 @@ spec:
|
|||
volumeMounts:
|
||||
- name: templates
|
||||
mountPath: /app/src/templates
|
||||
|
||||
- name: templates
|
||||
csi:
|
||||
driver: gcsfuse.run.googleapis.com
|
||||
readOnly: true
|
||||
volumeAttributes:
|
||||
bucketName: templates
|
||||
volumes:
|
||||
- name: templates
|
||||
csi:
|
||||
driver: gcsfuse.run.googleapis.com
|
||||
readOnly: true
|
||||
volumeAttributes:
|
||||
bucketName: templates
|
Loading…
Reference in New Issue
Block a user