Skip to content

Commit

Permalink
RT-979: Create Jenkinsfile-prod
Browse files Browse the repository at this point in the history
  • Loading branch information
semicolin committed Oct 24, 2023
1 parent 03f7488 commit a339c7c
Showing 1 changed file with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions Jenkinsfile-prod
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
pipeline {
agent any
options {
buildDiscarder(logRotator(numToKeepStr: '10'))
}
environment {
AWS_ACCOUNTS = '475186532573'
AWS_CREDENTIALS = credentials('AWS-KEYS')
AWS_ENV = """${sh(
returnStdout: true,
script: 'env | awk -F= \'/^AWS/ {print "-e " $1}\''
)}"""
GIT_ENV = """${sh(
returnStdout: true,
script: 'env | awk -F= \'/^GIT/ {print "-e " $1}\''
)}"""
}
stages {
stage('Setup') {
steps {
sh '''
docker pull $CICD_ECR_REGISTRY/cicd:latest
docker tag $CICD_ECR_REGISTRY/cicd:latest cicd:latest
'''
}
}
stage('Promote') {
steps {
echo 'Promoting from INTERNAL to PROD'
sh 'docker run -v /var/run/docker.sock:/var/run/docker.sock $AWS_ENV $GIT_ENV cicd promote smart-launcher-v2 internal'
}
}
stage('Wait') {
steps {
echo 'Waiting for service to reach steady state'
sh 'docker run -v /var/run/docker.sock:/var/run/docker.sock $AWS_ENV cicd wait smart-launcher-v2 prod'
}
}
stage('Healthcheck') {
steps {
echo 'Checking health of service'
sh 'curl -m 10 https://smart-launcher-v2.elimuinformatics.com/'
}
}
}
post {
unsuccessful {
slackSend color: 'danger', channel: '#product-ops-prod', message: "Pipeline Failed: ${env.JOB_NAME} ${env.BUILD_NUMBER} (<${env.BUILD_URL}|Open>)"
}
fixed {
slackSend color: 'good', channel: '#product-ops-prod', message: "Pipeline Ran Successfully: ${env.JOB_NAME} ${env.BUILD_NUMBER} (<${env.BUILD_URL}|Open>)"
}
}
}

0 comments on commit a339c7c

Please sign in to comment.