added email notifications to Jenkinsfile #38
nclazz/codebuilder/pipeline/head This commit looks good
Details
nclazz/codebuilder/pipeline/head This commit looks good
Details
parent
88fe95c856
commit
97c37472b6
|
@ -29,6 +29,54 @@ pipeline {
|
|||
}
|
||||
}
|
||||
post {
|
||||
failure {
|
||||
script {
|
||||
emailext(
|
||||
to: "notifications@nclazz.de",
|
||||
from: "jenkins@nclazz.de",
|
||||
subject: "Jenkins job ${env.JOB_NAME}#${env.BUILD_NUMBER} failed",
|
||||
body: """
|
||||
There is a build failure in ${env.JOB_NAME}.
|
||||
Build: ${env.BUILD_URL}
|
||||
Logs: ${env.BUILD_URL}console
|
||||
Changes: ${env.BUILD_URL}changes
|
||||
--
|
||||
"""
|
||||
)
|
||||
}
|
||||
}
|
||||
unstable {
|
||||
script {
|
||||
emailext(
|
||||
to: "notifications@nclazz.de",
|
||||
from: "jenkins@nclazz.de",
|
||||
subject: "Jenkins job ${env.JOB_NAME}#${env.BUILD_NUMBER} unstable",
|
||||
body: """
|
||||
Some tests have failed in ${env.JOB_NAME}.
|
||||
Build: ${env.BUILD_URL}
|
||||
Logs: ${env.BUILD_URL}console
|
||||
Changes: ${env.BUILD_URL}changes
|
||||
--
|
||||
"""
|
||||
)
|
||||
}
|
||||
}
|
||||
fixed {
|
||||
script {
|
||||
emailext(
|
||||
to: "notifications@nclazz.de",
|
||||
from: "jenkins@nclazz.de",
|
||||
subject: "Jenkins job ${env.JOB_NAME}#${env.BUILD_NUMBER} fixed",
|
||||
body: """
|
||||
The build ${env.JOB_NAME} completed successfully and is back to normal.
|
||||
Build: ${env.BUILD_URL}
|
||||
Logs: ${env.BUILD_URL}console
|
||||
Changes: ${env.BUILD_URL}changes
|
||||
--
|
||||
"""
|
||||
)
|
||||
}
|
||||
}
|
||||
always {
|
||||
cleanWs()
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue