Try to send email on failure build
This commit is contained in:
parent
33c9b4ee78
commit
fd4261013e
|
@ -4,6 +4,7 @@ pipeline {
|
|||
}
|
||||
environment {
|
||||
DEB_REPOSITORY_URI = credentials('jenkins-eza-build-repository-uri')
|
||||
EMAIL_TO = credentials('jenkins-eza-build-email-to')
|
||||
}
|
||||
stages {
|
||||
stage('Test if a new build is required…') {
|
||||
|
@ -55,4 +56,17 @@ pipeline {
|
|||
}
|
||||
}
|
||||
}
|
||||
post {
|
||||
failure {
|
||||
emailext(
|
||||
to: '${EMAIL_TO}',
|
||||
subject: "Failed job: \'${env.JOB_NAME}:${env.BUILD_NUMBER}\'",
|
||||
body: """
|
||||
<p>EXECUTED: Job <b>\'${env.JOB_NAME}:${env.BUILD_NUMBER}\'</b></p>
|
||||
<p>Status: <b>Failed</b></p>
|
||||
<p>View console output at "<a href="${env.BUILD_URL}">${env.JOB_NAME}:${env.BUILD_NUMBER}</a>"</p>
|
||||
"""
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue