Skip to content

Commit 6cf58d7

Browse files
authored
Merge pull request #23 from Police-Data-Accessibility-Project/mc_600_post_failure_notification
feat(Add post-failure discord notification):
2 parents 626f422 + f7741de commit 6cf58d7

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

Jenkinsfile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,17 @@ pipeline {
2121
}
2222
}
2323
}
24+
post {
25+
failure {
26+
script {
27+
def payload = """{
28+
"content": "🚨 Build Failed: ${env.JOB_NAME} #${env.BUILD_NUMBER}"
29+
}"""
30+
31+
sh """
32+
curl -X POST -H "Content-Type: application/json" -d '${payload}' ${env.WEBHOOK_URL}
33+
"""
34+
}
35+
}
36+
}
2437
}

0 commit comments

Comments
 (0)