Skip to content

Slack Notification

Slack + Github

Link Slack with github account following these images:

app gh-app connect github code


auth connect free install plan open


Jenkins + Slack

  1. Create Slack channel to receive the notifications once a build in Jenkins finish.
  2. App > Jenkins > Add >. Configuration app jenkins add link channel instructions settings slack-jenkins secret

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}"        
    }
}

results

builds

slack results