1
0
Fork 0

Try to send email on failure build

This commit is contained in:
gardouille 2023-10-09 11:13:03 +02:00
parent 33c9b4ee78
commit fd4261013e
Signed by: gardouille
GPG Key ID: E759BAA22501AF32
1 changed files with 14 additions and 0 deletions

14
Jenkinsfile vendored
View File

@ -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>
"""
)
}
}
}