Commit c4bf8667 authored by carlosribas's avatar carlosribas
Browse files

Updating pipeline

parent 442bfba1
pipeline { pipeline {
agent any agent any
environment {
SLACK = credentials('slack-notification')
}
parameters { parameters {
choice( choice(
name: 'CLUSTER', name: 'CLUSTER',
...@@ -52,27 +55,41 @@ pipeline { ...@@ -52,27 +55,41 @@ pipeline {
case 'TEST': case 'TEST':
env.RELEASE = 'full-dev' env.RELEASE = 'full-dev'
env.NAMESPACE = 'dev' env.NAMESPACE = 'dev'
env.VALUES = '--values=values.dev.yaml'
break break
case 'PROD': case 'PROD':
env.RELEASE = 'full-prod' env.RELEASE = 'full-prod'
env.NAMESPACE = 'prod' env.NAMESPACE = 'prod'
env.VALUES = ''
break break
} }
if (params.CLUSTER == 'HX') { if (params.CLUSTER == 'HX') {
withCredentials([file(credentialsId: 'HX-WP-Config', variable: 'config')]) { withCredentials([file(credentialsId: 'HX-WP-Config', variable: 'config')]) {
sh """ sh """
curl -X POST -H 'Content-type: application/json' --data '{"text":"Starting the deployment of the ${params.BRANCH} image in ${params.WEB} of the ${params.CLUSTER} cluster"}' $SLACK
git checkout python3-version git checkout python3-version
cd kubernetes/helm cd kubernetes/helm
/net/isilonP/public/rw/homes/xfm_adm/.jenkins/helm upgrade --install ${RELEASE} . --kubeconfig ${config} --namespace ${NAMESPACE} --set proxy=proxy-hx,database=${DB},rnacentralBranch=${params.BRANCH} echo 'Deleting pods'
/net/isilonP/public/rw/homes/xfm_adm/.jenkins/helm uninstall ${RELEASE} --kubeconfig ${config} --namespace ${NAMESPACE}
sleep 10
echo 'Creating pods'
/net/isilonP/public/rw/homes/xfm_adm/.jenkins/helm upgrade --install ${RELEASE} --kubeconfig ${config} --namespace ${NAMESPACE} ${VALUES} --set proxy=proxy-hx,database=${DB},rnacentralBranch=${params.BRANCH} .
curl -X POST -H 'Content-type: application/json' --data '{"text":"Finishing the deployment of the ${params.BRANCH} image in ${params.WEB} of the ${params.CLUSTER} cluster. This may take a few more seconds. "}' $SLACK
""" """
} }
} else if (params.CLUSTER == 'HH') { } else if (params.CLUSTER == 'HH') {
withCredentials([file(credentialsId: 'HH-WP-Config', variable: 'config')]) { withCredentials([file(credentialsId: 'HH-WP-Config', variable: 'config')]) {
sh """ sh """
curl -X POST -H 'Content-type: application/json' --data '{"text":"Starting the deployment of the ${params.BRANCH} image in ${params.WEB} of the ${params.CLUSTER} cluster"}' $SLACK
git checkout python3-version git checkout python3-version
cd kubernetes/helm cd kubernetes/helm
/net/isilonP/public/rw/homes/xfm_adm/.jenkins/helm upgrade --install ${RELEASE} . --kubeconfig ${config} --namespace ${NAMESPACE} --set proxy=proxy-hh,database=${DB},rnacentralBranch=${params.BRANCH} echo 'Deleting pods'
/net/isilonP/public/rw/homes/xfm_adm/.jenkins/helm uninstall ${RELEASE} --kubeconfig ${config} --namespace ${NAMESPACE}
sleep 10
echo 'Creating pods'
/net/isilonP/public/rw/homes/xfm_adm/.jenkins/helm upgrade --install ${RELEASE} --kubeconfig ${config} --namespace ${NAMESPACE} ${VALUES} --set proxy=proxy-hh,database=${DB},rnacentralBranch=${params.BRANCH} .
curl -X POST -H 'Content-type: application/json' --data '{"text":"Finishing the deployment of the ${params.BRANCH} image in ${params.WEB} of the ${params.CLUSTER} cluster. This may take a few more seconds. "}' $SLACK
""" """
} }
} }
...@@ -80,4 +97,4 @@ pipeline { ...@@ -80,4 +97,4 @@ pipeline {
} }
} }
} }
} }
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment