From eb5ad650c96e9effe84239659760108c283c8293 Mon Sep 17 00:00:00 2001 From: Anton Romanov Date: Thu, 2 May 2024 14:17:44 +0400 Subject: [PATCH] #247 -- Fix jenkinsfile --- Jenkinsfile | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index fd2765f..61bb6a1 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -7,4 +7,22 @@ pipeline { } } } + post { + failure { + emailext body: 'Check console output at $BUILD_URL to view the results. \n\n ${CHANGES} \n\n -------------------------------------------------- \n${BUILD_LOG, maxLines=100, escapeHtml=false}', + to: "${EMAIL_TO}", + subject: 'Build failed in Jenkins: $PROJECT_NAME - #$BUILD_NUMBER' + } + unstable { + emailext body: 'Check console output at $BUILD_URL to view the results. \n\n ${CHANGES} \n\n -------------------------------------------------- \n${BUILD_LOG, maxLines=100, escapeHtml=false}', + to: "${EMAIL_TO}", + subject: 'Unstable build in Jenkins: $PROJECT_NAME - #$BUILD_NUMBER' + } + changed { + emailext body: 'Check console output at $BUILD_URL to view the results.', + to: "${EMAIL_TO}", + subject: 'Jenkins build is back to normal: $PROJECT_NAME - #$BUILD_NUMBER' + } + } + } } \ No newline at end of file