You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+28Lines changed: 28 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,6 +32,34 @@ Follow the video for configuring the declarative pipeline with SonarQube Integra
32
32
The following snippet enables the slack-alerts stage in the CI/CD pipeline. Watch the video to see the configurations and the `Jenkins-Slack` Integration Process.
33
33
34
34
```
35
+
//Add this after the "stage" blocks end.
36
+
37
+
post {
38
+
39
+
aborted {
40
+
41
+
echo "Sending message to Slack"
42
+
slackSend (color: "${env.SLACK_COLOR_WARNING}",
43
+
channel: "${params.SLACK_CHANNEL_2}",
44
+
message: "*ABORTED:* Job ${env.JOB_NAME} build ${env.BUILD_NUMBER} by ${env.USER_ID}\n More info at: ${env.BUILD_URL}")
45
+
} // aborted
46
+
47
+
failure {
48
+
49
+
echo "Sending message to Slack"
50
+
slackSend (color: "${env.SLACK_COLOR_DANGER}",
51
+
channel: "${params.SLACK_CHANNEL_2}",
52
+
message: "*FAILED:* Job ${env.JOB_NAME} build ${env.BUILD_NUMBER} by ${env.USER_ID}\n More info at: ${env.BUILD_URL}")
53
+
} // failure
54
+
55
+
success {
56
+
echo "Sending message to Slack"
57
+
slackSend (color: "${env.SLACK_COLOR_GOOD}",
58
+
channel: "${params.SLACK_CHANNEL_1}",
59
+
message: "*SUCCESS:* Job ${env.JOB_NAME} build ${env.BUILD_NUMBER} by ${env.USER_ID}\n More info at: ${env.BUILD_URL}")
0 commit comments