Skip to content

Commit 7254949

Browse files
author
Vitaly Korolev
committed
Update job names and email status
1 parent 4301f95 commit 7254949

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

Jenkinsfile

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import groovy.json.JsonSlurperClassic
77

88
9-
9+
emailSecList = '[email protected]'
1010
gitCredID = 'marklogic-builder-github'
1111
JIRA_ID = ''
1212
JIRA_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

@@ -151,7 +151,7 @@ void imageScan() {
151151
// trigger BlackDuck scan
152152
def rawImageList = readFile(file: 'helm_image.list').trim()
153153
def imageList = rawImageList.endsWith(',') ? rawImageList[0..-2] : rawImageList
154-
build job: 'securityscans/Blackduck/cloud/kubernetes-helm', wait: false, parameters: [ string(name: 'branch', value: "${env.BRANCH_NAME}"), string(name: 'CONTAINER_IMAGES', value: "${imageList}") ]
154+
build job: 'securityscans/Blackduck/KubeNinjas/kubernetes-helm', wait: false, parameters: [ string(name: 'branch', value: "${env.BRANCH_NAME}"), string(name: 'CONTAINER_IMAGES', value: "${imageList}") ]
155155
}
156156

157157
void publishTestResults() {
@@ -266,13 +266,16 @@ pipeline {
266266
sh "rm -rf $WORKSPACE/test/test_results/"
267267
}
268268
success {
269-
resultNotification('BUILD SUCCESS ✅')
269+
resultNotification('✅ Success')
270270
}
271271
failure {
272-
resultNotification('BUILD ERROR ❌')
272+
resultNotification('❌ Failure')
273273
}
274274
unstable {
275-
resultNotification('BUILD UNSTABLE ❌')
275+
resultNotification('⚠️ Unstable')
276+
}
277+
aborted {
278+
resultNotification('🚫 Aborted')
276279
}
277280
}
278281
}

0 commit comments

Comments
 (0)