From b79fb90f7a6d4dba0e24cbb1657345cd37a892d3 Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Sun, 5 Jun 2022 17:05:31 +1000 Subject: [PATCH] Add missing function Signed-off-by: Olivier Lamy --- Jenkinsfile | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index caba878bf..8f71dac15 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -271,4 +271,28 @@ pipeline { } } +// Send a notification about the build status +def notifyBuild(String buildStatus) { + // default the value + buildStatus = buildStatus ?: "UNKNOWN" + + def email = "notifications@archiva.apache.org" + def summary = "${env.JOB_NAME}#${env.BUILD_NUMBER} - ${buildStatus} - ${currentBuild?.currentResult}" + def detail = """

Job: ${env.JOB_NAME} [#${env.BUILD_NUMBER}]

+

${buildStatus}

+ + + + +
Build${env.BUILD_URL}
Console${env.BUILD_URL}console
Test Report${env.BUILD_URL}testReport/
+ """ + + emailext( + to: email, + subject: summary, + body: detail, + mimeType: 'text/html' + ) +} + // vim: et:ts=4:sw=4:ft=groovy -- 2.39.5