Notify slack on master branch build failure (#328)

Chris Mckay 6 years ago committed by GitHub
parent 6ca152551a
commit e60b784b7a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 20
      Jenkinsfile

20
Jenkinsfile vendored

@ -86,3 +86,23 @@ stage('Pantheon tests') {
}
}
}
// If we're on master and it failed, notify slack
if (env.BRANCH_NAME == "master") {
if (currentBuild.result != 'SUCCESSFUL') {
def channel = '#priv-pegasys-prod-dev'
if (currentBuild.result == 'FAILURE') {
slackSend(
color: 'danger',
msg: "Pantheon master branch build is FAILING.\nBuild Number: #${env.BUILD_NUMBER}\n${env.BUILD_URL}",
channel: channel
)
} else if (currentBuild.result == 'UNSTABLE') {
slackSend(
color: 'warning',
msg: "Pantheon master branch build is UNSTABLE.\nBuild Number: #${env.BUILD_NUMBER}\n${env.BUILD_URL}",
channel: channel
)
}
}
}

Loading…
Cancel
Save