Update firmador intern services
This commit is contained in:
parent
5a4868b397
commit
531c3c11e8
89
Jenkinsfile firm int
Normal file
89
Jenkinsfile firm int
Normal file
|
@ -0,0 +1,89 @@
|
||||||
|
pipeline {
|
||||||
|
agent any
|
||||||
|
environment {
|
||||||
|
CLOUDSDK_CORE_PROJECT = 'siman-448015'
|
||||||
|
REGION = "us-central1"
|
||||||
|
CLIENT_EMAIL = 'svfe-api-firmador@siman-448015.iam.gserviceaccount.com'
|
||||||
|
GCLOUD_CREDS = credentials('gcloud-creds')
|
||||||
|
CLOUD_RUN_FIRMADOR = 'http://localhost:8013'
|
||||||
|
}
|
||||||
|
|
||||||
|
stages {
|
||||||
|
|
||||||
|
stage('Clonar Repositorio') {
|
||||||
|
steps {
|
||||||
|
git credentialsId: 'token_gitea',
|
||||||
|
url: 'https://gitea.grupoconsiti.com/duvan_andres/prueba.git',
|
||||||
|
branch: 'main'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('Authenticate') {
|
||||||
|
steps {
|
||||||
|
withCredentials([file(credentialsId: 'gcloud-creds', variable: 'GCLOUD_CREDS')]) {
|
||||||
|
sh 'gcloud auth activate-service-account --key-file="$GCLOUD_CREDS"'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('Envs about Firmador') {
|
||||||
|
steps {
|
||||||
|
sh '''
|
||||||
|
sed -i "s|SERVICE_FIRMADOR_URL|${CLOUD_RUN_FIRMADOR}|g" **.yml
|
||||||
|
cat service-nest.yml
|
||||||
|
'''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('Deploy to Cloud Run Nest and Spring') {
|
||||||
|
steps {
|
||||||
|
script {
|
||||||
|
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()
|
||||||
|
|
||||||
|
def cloudRunUrlMatchNest = outputNest =~ /URL:\s+(https:\/\/[^\s]+)/
|
||||||
|
def cloudRunUrlMatchLotes = outputSpring =~ /URL:\s+(https:\/\/[^\s]+)/
|
||||||
|
|
||||||
|
if (cloudRunUrlMatchNest) {
|
||||||
|
env.CLOUD_RUN_NEST = cloudRunUrlMatchNest[0][1]
|
||||||
|
}
|
||||||
|
if (cloudRunUrlMatchLotes) {
|
||||||
|
env.CLOUD_RUN_LOTES = cloudRunUrlMatchLotes[0][1]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('Envs about Nest and Spring') {
|
||||||
|
steps {
|
||||||
|
sh '''
|
||||||
|
sed -i "s|SERVICE_NEST_URL|${CLOUD_RUN_NEST}|g" **.yml
|
||||||
|
sed -i "s|SERVICE_LOTES_URL|${CLOUD_RUN_LOTES}|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'
|
||||||
|
'''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('Allow allUsers') {
|
||||||
|
steps {
|
||||||
|
sh '''
|
||||||
|
gcloud run services add-iam-policy-binding cbii-apigateway-jenkins --region='us-central1' --member='allUsers' --role='roles/run.invoker'
|
||||||
|
'''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
post {
|
||||||
|
always {
|
||||||
|
sh 'gcloud auth revoke $CLIENT_EMAIL'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -101,12 +101,29 @@ spec:
|
||||||
key: '1'
|
key: '1'
|
||||||
name: ENVIRONMENT
|
name: ENVIRONMENT
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: templates_cbii
|
|
||||||
mountPath: /app/src/templates
|
|
||||||
volumes:
|
|
||||||
- name: templates_cbii
|
- name: templates_cbii
|
||||||
csi:
|
mountPath: /app/src/templates
|
||||||
driver: gcsfuse.run.googleapis.com
|
|
||||||
readOnly: true
|
- name: svfe-api-firmador-1
|
||||||
volumeAttributes:
|
image: svfe/svfe-api-firmador:v20230109
|
||||||
bucketName: templates_cbii
|
resources:
|
||||||
|
limits:
|
||||||
|
cpu: 500m
|
||||||
|
memory: 256Mi
|
||||||
|
volumeMounts:
|
||||||
|
- name: certifados
|
||||||
|
mountPath: /uploads
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
- name: certifados
|
||||||
|
csi:
|
||||||
|
driver: gcsfuse.run.googleapis.com
|
||||||
|
readOnly: true
|
||||||
|
volumeAttributes:
|
||||||
|
bucketName: certifados_prod
|
||||||
|
- name: templates_cbii
|
||||||
|
csi:
|
||||||
|
driver: gcsfuse.run.googleapis.com
|
||||||
|
readOnly: true
|
||||||
|
volumeAttributes:
|
||||||
|
bucketName: templates_cbii
|
||||||
|
|
|
@ -60,12 +60,13 @@ spec:
|
||||||
secretKeyRef:
|
secretKeyRef:
|
||||||
key: '1'
|
key: '1'
|
||||||
name: CRYPTO_NEST_DEV
|
name: CRYPTO_NEST_DEV
|
||||||
|
|
||||||
- name: svfe-api-firmador-1
|
- name: svfe-api-firmador-1
|
||||||
image: svfe/svfe-api-firmador:v20230109
|
image: svfe/svfe-api-firmador:v20230109
|
||||||
resources:
|
resources:
|
||||||
limits:
|
limits:
|
||||||
cpu: 1000m
|
cpu: 500m
|
||||||
memory: 512Mi
|
memory: 256Mi
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: certifados
|
- name: certifados
|
||||||
mountPath: /uploads
|
mountPath: /uploads
|
||||||
|
@ -75,11 +76,4 @@ spec:
|
||||||
driver: gcsfuse.run.googleapis.com
|
driver: gcsfuse.run.googleapis.com
|
||||||
readOnly: true
|
readOnly: true
|
||||||
volumeAttributes:
|
volumeAttributes:
|
||||||
bucketName: certifados_prod
|
bucketName: certifados_prod
|
||||||
|
|
||||||
- name: templates
|
|
||||||
csi:
|
|
||||||
driver: gcsfuse.run.googleapis.com
|
|
||||||
readOnly: true
|
|
||||||
volumeAttributes:
|
|
||||||
bucketName: templates
|
|
Loading…
Reference in New Issue
Block a user