Commit f890b97f authored by carlosribas's avatar carlosribas
Browse files

Add slack notification, but using secret text

parent e668266d
pipeline {
agent any
environment {
SLACK = credentials('slack-notification')
}
parameters {
choice(
name: 'CLUSTER',
......@@ -64,6 +67,7 @@ pipeline {
if (params.CLUSTER == 'HX') {
withCredentials([file(credentialsId: 'HX-WP-Config', variable: 'config')]) {
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
cd kubernetes/helm
echo 'Deleting pods'
......@@ -71,11 +75,13 @@ pipeline {
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') {
withCredentials([file(credentialsId: 'HH-WP-Config', variable: 'config')]) {
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
cd kubernetes/helm
echo 'Deleting pods'
......@@ -83,6 +89,7 @@ pipeline {
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
"""
}
}
......
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