parent
996c519e93
commit
2108ee3adc
7 changed files with 177 additions and 6 deletions
@ -0,0 +1,10 @@ |
||||
FROM amazoncorretto:11-alpine-full |
||||
WORKDIR /work |
||||
COPY target/*-runner.jar /work/application.jar |
||||
|
||||
ENV TZ="America/Santiago" |
||||
ENV MS_PORT=8080 |
||||
|
||||
EXPOSE 8080 |
||||
|
||||
CMD ["java","-jar","application.jar"] |
||||
@ -0,0 +1,123 @@ |
||||
pipeline { |
||||
agent { |
||||
node { |
||||
label 'MachineSlave1' |
||||
} |
||||
} |
||||
environment { |
||||
SUCCESS = 'true' |
||||
STAGE = 'none' |
||||
IMAGE_DOCKER = 'registry.vodorod.cl/deal/tienda-playa-servicio:latest' |
||||
} |
||||
stages { |
||||
stage('Quarkus Compile') { |
||||
steps { |
||||
sh 'chmod +x mvnw && ./mvnw package -Dquarkus.package.type=uber-jar -Dquarkus.profile=prod' |
||||
} |
||||
post { |
||||
success { |
||||
script { |
||||
SUCCESS = 'true' |
||||
STAGE = 'Quarkus Compile' |
||||
} |
||||
} |
||||
failure { |
||||
script { |
||||
SUCCESS = 'false' |
||||
STAGE = 'Quarkus Compile' |
||||
} |
||||
} |
||||
aborted { |
||||
script { |
||||
SUCCESS = 'false' |
||||
STAGE = 'Quarkus Compile' |
||||
} |
||||
} |
||||
} |
||||
} |
||||
stage('Docker Build') { |
||||
when { equals expected: 'true', actual: SUCCESS } |
||||
steps { |
||||
sh 'docker build -t ${IMAGE_DOCKER} .' |
||||
} |
||||
post { |
||||
success { |
||||
script { |
||||
SUCCESS = 'true' |
||||
STAGE = 'Docker Build' |
||||
} |
||||
} |
||||
failure { |
||||
script { |
||||
SUCCESS = 'false' |
||||
STAGE = 'Docker Build' |
||||
} |
||||
} |
||||
aborted { |
||||
script { |
||||
SUCCESS = 'false' |
||||
STAGE = 'Docker Build' |
||||
} |
||||
} |
||||
} |
||||
} |
||||
stage('Docker Push') { |
||||
when { equals expected: 'true', actual: SUCCESS } |
||||
steps { |
||||
withCredentials([usernamePassword(credentialsId: 'vodorodRegistry', passwordVariable: 'vodorodRegistryPassword', usernameVariable: 'vodorodRegistryUser')]) { |
||||
sh "docker login registry.vodorod.cl -u ${env.vodorodRegistryUser} -p ${env.vodorodRegistryPassword}" |
||||
sh 'docker push ${IMAGE_DOCKER}' |
||||
} |
||||
} |
||||
post { |
||||
success { |
||||
script { |
||||
SUCCESS = 'true' |
||||
STAGE = 'Docker Push' |
||||
} |
||||
} |
||||
failure { |
||||
script { |
||||
SUCCESS = 'false' |
||||
STAGE = 'Docker Push' |
||||
} |
||||
} |
||||
aborted { |
||||
script { |
||||
SUCCESS = 'false' |
||||
STAGE = 'Docker Push' |
||||
} |
||||
} |
||||
} |
||||
} |
||||
} |
||||
post { |
||||
success { |
||||
script { |
||||
withCredentials([string(credentialsId: 'telegramToken', variable: 'TOKEN'), string(credentialsId: 'telegramChatId', variable: 'CHAT_ID')]) { |
||||
sh """ |
||||
curl -s -X POST https://api.telegram.org/bot${TOKEN}/sendMessage -d chat_id=${CHAT_ID} -d parse_mode="HTML" -d text="<b>Project</b> : ${env.JOB_NAME} \n<b>Branch</b>: ${BRANCH_NAME} \n<b>Build </b> : Complete \n<b>Status</b> : Passed \n<b>Node</b> : ${env.NODE_NAME}" |
||||
""" |
||||
} |
||||
} |
||||
} |
||||
failure { |
||||
script { |
||||
withCredentials([string(credentialsId: 'telegramToken', variable: 'TOKEN'), string(credentialsId: 'telegramChatId', variable: 'CHAT_ID')]) { |
||||
sh """ |
||||
curl -s -X POST https://api.telegram.org/bot${TOKEN}/sendMessage -d chat_id=${CHAT_ID} -d parse_mode="HTML" -d text="<b>Project</b> : ${env.JOB_NAME} \n<b>Branch</b>: ${BRANCH_NAME} \n<b>Build </b> : ${STAGE} \n<b>Status</b> : Failed \n<b>Node</b> : ${env.NODE_NAME}" |
||||
""" |
||||
} |
||||
} |
||||
} |
||||
aborted { |
||||
script { |
||||
withCredentials([string(credentialsId: 'telegramToken', variable: 'TOKEN'), string(credentialsId: 'telegramChatId', variable: 'CHAT_ID')]) { |
||||
sh """ |
||||
curl -s -X POST https://api.telegram.org/bot${TOKEN}/sendMessage -d chat_id=${CHAT_ID} -d parse_mode="HTML" -d text="<b>Project</b> : ${env.JOB_NAME} \n<b>Branch</b>: ${BRANCH_NAME} \n<b>Build </b> : ${STAGE} \n<b>Status</b> : Aborted \n<b>Node</b> : ${env.NODE_NAME}" |
||||
""" |
||||
} |
||||
} |
||||
} |
||||
} |
||||
} |
||||
@ -0,0 +1,14 @@ |
||||
version: '3.9' |
||||
|
||||
services: |
||||
servicio: |
||||
image: registry.vodorod.cl/deal/tienda-playa-servicio:latest |
||||
restart: always |
||||
ports: |
||||
- "8181:8080" |
||||
environment: |
||||
DATABASE_USER: 'postgres' |
||||
DATABASE_PASS: '13467982' |
||||
DATABASE_JDBC: 'jdbc:postgresql://192.168.1.4:5432/postgres?currentSchema=playa' |
||||
volumes: |
||||
- ./logs:/work/logs |
||||
@ -0,0 +1,14 @@ |
||||
version: '3.9' |
||||
|
||||
services: |
||||
servicio: |
||||
image: registry.vodorod.cl/deal/tienda-playa-servicio:latest |
||||
restart: always |
||||
ports: |
||||
- "8181:8080" |
||||
environment: |
||||
DATABASE_USER: 'playa_tienda' |
||||
DATABASE_PASS: 'ED8eqKY5ZyQAH9px' |
||||
DATABASE_JDBC: 'jdbc:postgresql://45.236.128.250:5432/postgres?currentSchema=playa' |
||||
volumes: |
||||
- ./logs:/work/logs |
||||
Loading…
Reference in new issue