This is an automated email from the ASF dual-hosted git repository. olamy pushed a commit to branch master-jenkinsfile-it-test in repository https://gitbox.apache.org/repos/asf/archiva.git
commit 96b04bc79fe8deb3ebdebf9f660cd9c698a7ed25 Author: Olivier Lamy <[email protected]> AuthorDate: Sun Jun 5 17:05:31 2022 +1000 Add missing function Signed-off-by: Olivier Lamy <[email protected]> --- Jenkinsfile | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index 495a75d71..b9905a7c9 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 = "[email protected]" + def summary = "${env.JOB_NAME}#${env.BUILD_NUMBER} - ${buildStatus} - ${currentBuild?.currentResult}" + def detail = """<h4>Job: <a href='${env.JOB_URL}'>${env.JOB_NAME}</a> [#${env.BUILD_NUMBER}]</h4> + <p><b>${buildStatus}</b></p> + <table> + <tr><td>Build</td><td><a href='${env.BUILD_URL}'>${env.BUILD_URL}</a></td><tr> + <tr><td>Console</td><td><a href='${env.BUILD_URL}console'>${env.BUILD_URL}console</a></td><tr> + <tr><td>Test Report</td><td><a href='${env.BUILD_URL}testReport/'>${env.BUILD_URL}testReport/</a></td><tr> + </table> + """ + + emailext( + to: email, + subject: summary, + body: detail, + mimeType: 'text/html' + ) +} + // vim: et:ts=4:sw=4:ft=groovy
