This is an automated email from the ASF dual-hosted git repository.
olamy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/archiva-jenkins-lib.git
The following commit(s) were added to refs/heads/master by this push:
new 3433851 add notifyBuild function in shared library
3433851 is described below
commit 3433851cfeafbdc53586c6c043e62cb2834e06a2
Author: olivier lamy <[email protected]>
AuthorDate: Sat Dec 29 22:01:22 2018 +1000
add notifyBuild function in shared library
Signed-off-by: olivier lamy <[email protected]>
---
vars/asfStandardBuild.groovy | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
diff --git a/vars/asfStandardBuild.groovy b/vars/asfStandardBuild.groovy
index 8e4ab90..db08a97 100644
--- a/vars/asfStandardBuild.groovy
+++ b/vars/asfStandardBuild.groovy
@@ -84,4 +84,27 @@ def mavenBuild(jdk, cmdline, mvnName, publishers) {
}
}
+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=2:sw=2:ft=groovy