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

Commit

Permalink
Notify on abort (#26)
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 Sep 18, 2020
1 parent 7cd2174 commit f4dc638
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,17 @@ pipeline {
}
}
post {
failure {
always {
script {
if (env.BRANCH_NAME == 'master')
if ((env.BRANCH_NAME == 'master') && (currentBuild.currentResult == "ABORTED" || currentBuild.currentResult == "FAILURE")){
stage('notify master branch fail') {
script {
def data = [text: "Attention! assisted-ignition-generator branch test failed, see: ${BUILD_URL}"]
writeJSON(file: 'data.txt', json: data, pretty: 4)
}
sh '''curl -X POST -H 'Content-type: application/json' --data-binary "@data.txt" https://hooks.slack.com/services/${SLACK_TOKEN}'''
}
}
}
}
}
Expand Down

0 comments on commit f4dc638

Please sign in to comment.