Added build notifications in Jenkinsfile

This commit is contained in:
ashish committed 2023-11-19 16:52:10 -06:00
1 parent e2812494a0
commit 615ca9ba8e
1 file changed
+8
Vendored
+8
View File
@@ -22,6 +22,14 @@ pipeline {
}
post {
failure {
httpRequest contentType: 'APPLICATION_JSON', httpMode: 'POST', ignoreSslErrors: true, requestBody: "{\"topic\": \"jenkins\", \"title\": \"Jenkins\", \"priority\": 4, \"icon\": \"https://jenkins.homelab.net/favicon.ico\", \"click\": \"${BUILD_URL}\", \"message\": \"Build failed for ${JOB_BASE_NAME} on ${BRANCH_NAME} branch\"}", responseHandle: 'NONE', url: 'https://ntfy.homelab.net', wrapAsMultipart: false
}
fixed {
httpRequest contentType: 'APPLICATION_JSON', httpMode: 'POST', ignoreSslErrors: true, requestBody: "{\"topic\": \"jenkins\", \"title\": \"Jenkins\", \"priority\": 3, \"icon\": \"https://jenkins.homelab.net/favicon.ico\", \"click\": \"${BUILD_URL}\", \"message\": \"Pipeline fixed for ${JOB_BASE_NAME} on ${BRANCH_NAME} branch\"}", responseHandle: 'NONE', url: 'https://ntfy.homelab.net', wrapAsMultipart: false
}
cleanup {
cleanWs()
}