Skip to content
This repository has been archived by the owner on Apr 15, 2019. It is now read-only.

Commit

Permalink
Merge pull request #782 from fchavant/slack-notification-on-recovery
Browse files Browse the repository at this point in the history
Slack notification on recovery
  • Loading branch information
slaweet authored Sep 28, 2017
2 parents 8b71c17 + cb840be commit 9890360
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
def fail(reason) {
def pr_branch = ''
if (env.CHANGE_BRANCH != null) {
pr_branch = " ($BRANCH_NAME)"
pr_branch = " (${env.CHANGE_BRANCH})"
}
slackSend color: 'danger', message: "Build #${env.BUILD_NUMBER} of <${env.BUILD_URL}|${env.JOB_NAME}>${pr_branch} failed (<${env.BUILD_URL}/console|console>, <${env.BUILD_URL}/changes|changes>)\nCause: ${reason}", channel: '#lisk-nano-jenkins'
currentBuild.result = 'FAILURE'
Expand Down Expand Up @@ -147,6 +147,10 @@ node('lisk-nano-01'){
fail('Stopping build, Deploy failed')
}
milestone 1
/* notify of success if previous build failed */
if (currentBuild.getPreviousBuild().result == 'FAILURE') {
slackSend color: 'good', message: "Recovery: build #${env.BUILD_NUMBER} of <${env.BUILD_URL}|${env.JOB_NAME}> was sucessful.", channel: '#lisk-nano-jenkins'
}
}
}
}

0 comments on commit 9890360

Please sign in to comment.