You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@archiva.apache.org by ol...@apache.org on 2022/06/05 11:40:54 UTC

[archiva] 02/03: Add missing function

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 795a0bd5648bbeee8ccbe7c3e63a0857900f37df
Author: Olivier Lamy <ol...@apache.org>
AuthorDate: Sun Jun 5 17:05:31 2022 +1000

    Add missing function
    
    Signed-off-by: Olivier Lamy <ol...@apache.org>
---
 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 = "notifications@archiva.apache.org"
+    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