66import groovy.json.JsonSlurperClassic
77
889- 9+ emailSecList
= ' [email protected] ' 1010gitCredID = ' marklogic-builder-github'
1111JIRA_ID = ' '
1212JIRA_ID_PATTERN = / (?i)(MLE)-\d {3,6}/
@@ -103,7 +103,7 @@ def getReviewState() {
103103 return reviewState
104104}
105105
106- void resultNotification (message ) {
106+ void resultNotification (status ) {
107107 def author, authorEmail, emailList
108108 if (env. CHANGE_AUTHOR ) {
109109 author = env. CHANGE_AUTHOR . toString(). trim(). toLowerCase()
@@ -117,11 +117,11 @@ void resultNotification(message) {
117117 jira_email_body = " ${ email_body} <br><br><b>Jira URL: </b><br><a href='${ jira_link} '>${ jira_link} </a>"
118118
119119 if (JIRA_ID ) {
120- def comment = [ body : " Jenkins pipeline build result: ${ message } " ]
120+ def comment = [ body : " Jenkins pipeline build result: ${ status } " ]
121121 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} "
123123 } 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} "
125125 }
126126}
127127
@@ -147,6 +147,11 @@ void imageScan() {
147147 }
148148
149149 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} " ) ]
150155}
151156
152157void publishTestResults () {
@@ -261,13 +266,16 @@ pipeline {
261266 sh " rm -rf $WORKSPACE /test/test_results/"
262267 }
263268 success {
264- resultNotification(' BUILD SUCCESS ✅ ' )
269+ resultNotification(' ✅ Success ' )
265270 }
266271 failure {
267- resultNotification(' BUILD ERROR ❌ ' )
272+ resultNotification(' ❌ Failure ' )
268273 }
269274 unstable {
270- resultNotification(' BUILD UNSTABLE ❌' )
275+ resultNotification(' ⚠️ Unstable' )
276+ }
277+ aborted {
278+ resultNotification(' 🚫 Aborted' )
271279 }
272280 }
273281}
0 commit comments