6
6
import groovy.json.JsonSlurperClassic
7
7
8
8
9
-
9
+ emailSecList
= ' [email protected] '
10
10
gitCredID = ' marklogic-builder-github'
11
11
JIRA_ID = ' '
12
12
JIRA_ID_PATTERN = / (?i)(MLE)-\d {3,6}/
@@ -103,7 +103,7 @@ def getReviewState() {
103
103
return reviewState
104
104
}
105
105
106
- void resultNotification (message ) {
106
+ void resultNotification (status ) {
107
107
def author, authorEmail, emailList
108
108
if (env. CHANGE_AUTHOR ) {
109
109
author = env. CHANGE_AUTHOR . toString(). trim(). toLowerCase()
@@ -117,11 +117,11 @@ void resultNotification(message) {
117
117
jira_email_body = " ${ email_body} <br><br><b>Jira URL: </b><br><a href='${ jira_link} '>${ jira_link} </a>"
118
118
119
119
if (JIRA_ID ) {
120
- def comment = [ body : " Jenkins pipeline build result: ${ message } " ]
120
+ def comment = [ body : " Jenkins pipeline build result: ${ status } " ]
121
121
jiraAddComment site : ' JIRA' , idOrKey : JIRA_ID , failOnError : false , input : comment
122
- mail charset : ' UTF-8' , mimeType : ' text/html' , to : " ${ emailList} " , body : " ${ jira_email_body} " , subject : " ${ message } : ${ env.JOB_NAME} #${ env.BUILD_NUMBER} - ${ JIRA_ID} "
122
+ mail charset : ' UTF-8' , mimeType : ' text/html' , to : " ${ emailList} " , body : " ${ jira_email_body} " , subject : " 🥷 ${ status } : ${ env.JOB_NAME} #${ env.BUILD_NUMBER} - ${ JIRA_ID} "
123
123
} else {
124
- mail charset : ' UTF-8' , mimeType : ' text/html' , to : " ${ emailList} " , body : " ${ email_body} " , subject : " ${ message } : ${ env.JOB_NAME} #${ env.BUILD_NUMBER} "
124
+ mail charset : ' UTF-8' , mimeType : ' text/html' , to : " ${ emailList} " , body : " ${ email_body} " , subject : " 🥷 ${ status } : ${ env.JOB_NAME} #${ env.BUILD_NUMBER} "
125
125
}
126
126
}
127
127
@@ -147,6 +147,11 @@ void imageScan() {
147
147
}
148
148
149
149
sh ''' rm -f dep-image-scan.txt'''
150
+
151
+ // trigger BlackDuck scan
152
+ def rawImageList = readFile(file : ' helm_image.list' ). trim()
153
+ def imageList = rawImageList. endsWith(' ,' ) ? rawImageList[0 .. -2 ] : rawImageList
154
+ build job : ' securityscans/Blackduck/KubeNinjas/kubernetes-helm' , wait : false , parameters : [ string(name : ' branch' , value : " ${ env.BRANCH_NAME} " ), string(name : ' CONTAINER_IMAGES' , value : " ${ imageList} " ) ]
150
155
}
151
156
152
157
void publishTestResults () {
@@ -261,13 +266,16 @@ pipeline {
261
266
sh " rm -rf $WORKSPACE /test/test_results/"
262
267
}
263
268
success {
264
- resultNotification(' BUILD SUCCESS ✅ ' )
269
+ resultNotification(' ✅ Success ' )
265
270
}
266
271
failure {
267
- resultNotification(' BUILD ERROR ❌ ' )
272
+ resultNotification(' ❌ Failure ' )
268
273
}
269
274
unstable {
270
- resultNotification(' BUILD UNSTABLE ❌' )
275
+ resultNotification(' ⚠️ Unstable' )
276
+ }
277
+ aborted {
278
+ resultNotification(' 🚫 Aborted' )
271
279
}
272
280
}
273
281
}
0 commit comments