Skip to content
This repository has been archived by the owner on Oct 19, 2020. It is now read-only.

Commit

Permalink
Notification when master integration failed (#11)
Browse files Browse the repository at this point in the history
Co-authored-by: osher cohen <[email protected]>
  • Loading branch information
oshercc and osher cohen authored Aug 18, 2020
1 parent 8679163 commit 65d96a9
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,17 @@ pipeline {
}

}
}
}
post {
failure {
script {
if (env.BRANCH_NAME == 'master')
stage('notify master branch fail') {
withCredentials([string(credentialsId: 'slack-token', variable: 'TOKEN')]) {
sh '''curl -X POST -H 'Content-type: application/json' --data '{"text":"Attention! master branch push integration failed, Check $BUILD_URL"}' https://hooks.slack.com/services/${TOKEN}'''
}
}
}
}
}
}

0 comments on commit 65d96a9

Please sign in to comment.