Slack Notification
Slack + Github¶
Link Slack with github account following these images:
Jenkins + Slack¶
- Create Slack channel to receive the notifications once a build in Jenkins finish.
- App > Jenkins > Add >. Configuration
Jenkinsfile¶
post {
success {
echo 'success!'
slackSend color: "#11cd4b", channel: "#sqa-challenge-fabianpg-notif", message: "*Build Passed*\n Job: ${env.JOB_NAME}\n Build: ${env.BUILD_NUMBER}\n URL: ${env.BUILD_URL}"
}
failure {
echo 'marked as failure'
slackSend color: "#F50407", channel: "#sqa-challenge-fabianpg-notif", message: "*Build Failed*\n Job: ${env.JOB_NAME}\n Build: ${env.BUILD_NUMBER}\n URL: ${env.BUILD_URL}"
}
unstable {
echo 'marked as unstable'
slackSend color: "#df6805", channel: "#sqa-challenge-fabianpg-notif", message: "*Build Unstable*\n Job: ${env.JOB_NAME}\n Build: ${env.BUILD_NUMBER}\n URL: ${env.BUILD_URL}"
}
aborted {
echo 'aborted'
slackSend color: "#f3f024", channel: "#sqa-challenge-fabianpg-notif", message: "*Build Aborted*\n Job: ${env.JOB_NAME}\n Build: ${env.BUILD_NUMBER}\n URL: ${env.BUILD_URL}"
}
}