6
6
import groovy.json.JsonSlurperClassic
7
7
8
8
emailList = ' vitaly.korolev@progress.com, sumanth.ravipati@progress.com, peng.zhou@progress.com, fayez.saliba@progress.com, barkha.choithani@progress.com, romain.winieski@progress.com'
9
- emailSecList = ' Rangan.Doreswamy@progress.com, Mahalakshmi.Srinivasan@progress.com'
9
+ emailSecList = ' Mahalakshmi.Srinivasan@progress.com'
10
10
gitCredID = ' marklogic-builder-github'
11
11
JIRA_ID = ' '
12
12
JIRA_ID_PATTERN = / (?i)(MLE)-\d {3,6}/
@@ -44,6 +44,7 @@ void preBuildCheck() {
44
44
sh '''
45
45
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b /space/go/bin v1.50.0
46
46
wget https://github.com/gotestyourself/gotestsum/releases/download/v1.12.0/gotestsum_1.12.0_linux_amd64.tar.gz -O gotestsum.tar.gz
47
+ mkdir -p /space/go/bin/
47
48
tar -xf gotestsum.tar.gz -C /space/go/bin/ gotestsum
48
49
'''
49
50
}
@@ -102,7 +103,7 @@ def getReviewState() {
102
103
return reviewState
103
104
}
104
105
105
- void resultNotification (message ) {
106
+ void resultNotification (status ) {
106
107
def author, authorEmail, emailList
107
108
if (env. CHANGE_AUTHOR ) {
108
109
author = env. CHANGE_AUTHOR . toString(). trim(). toLowerCase()
@@ -116,11 +117,11 @@ void resultNotification(message) {
116
117
jira_email_body = " ${ email_body} <br><br><b>Jira URL: </b><br><a href='${ jira_link} '>${ jira_link} </a>"
117
118
118
119
if (JIRA_ID ) {
119
- def comment = [ body : " Jenkins pipeline build result: ${ message } " ]
120
+ def comment = [ body : " Jenkins pipeline build result: ${ status } " ]
120
121
jiraAddComment site : ' JIRA' , idOrKey : JIRA_ID , failOnError : false , input : comment
121
- 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} "
122
123
} else {
123
- 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} "
124
125
}
125
126
}
126
127
@@ -146,6 +147,10 @@ void imageScan() {
146
147
}
147
148
148
149
sh ''' rm -f dep-image-scan.txt'''
150
+
151
+ // trigger BlackDuck scan
152
+ def imageList = readFile(file : ' helm_image.list' ). trim()
153
+ build job : ' securityscans/Blackduck/KubeNinjas/kubernetes-helm' , wait : false , parameters : [ string(name : ' branch' , value : " ${ env.BRANCH_NAME} " ), string(name : ' CONTAINER_IMAGES' , value : " ${ imageList} " ) ]
149
154
}
150
155
151
156
void publishTestResults () {
@@ -165,22 +170,23 @@ pipeline {
165
170
skipStagesAfterUnstable()
166
171
}
167
172
triggers {
168
- parameterizedCron( env. BRANCH_NAME == ' develop' ? ''' 00 04 * * * % IMAGE_SCAN=true;HELM_UPGRADE_TESTS=true;HC_TESTS=true''' : ' ' )
173
+ parameterizedCron( env. BRANCH_NAME == ' develop' ? ''' 00 04 * * * % IMAGE_SCAN=true;HELM_UPGRADE_TESTS=true;HC_TESTS=true
174
+ 00 04 * * * % dockerImageType=ubi''' : ' ' )
169
175
}
170
176
environment {
171
177
dockerRegistry = ' ml-docker-db-dev-tierpoint.bed-artifactory.bedford.progress.com'
172
178
dockerRepository = " ${ dockerRegistry} /marklogic/marklogic-server-${ params.dockerImageType} "
173
179
PATH = " /space/go/bin:${ env.PATH} "
174
- MINIKUBE_HOME = " /space"
180
+ MINIKUBE_HOME = " /space/minikube/ "
175
181
KUBECONFIG = " /space/.kube-config"
176
182
GOPATH = " /space/go"
177
183
}
178
184
179
185
parameters {
180
- choice(name : ' dockerImageType' , choices : ' ubi-rootless\n ubi\n centos ' , description : ' Platform type for Docker image' )
186
+ choice(name : ' dockerImageType' , choices : ' ubi-rootless\n ubi\n ubi9-rootless \n ubi9 ' , description : ' Platform type for Docker image' )
181
187
string(name : ' dockerVersion' , defaultValue : ' latest-11' , description : ' Docker tag to use for tests. (e.g. 11.2.nightly-ubi-rootless-1.1.2) Has to correspond with dockerImageType.' , trim : true )
182
188
string(name : ' prevDockerVersion' , defaultValue : ' latest-10' , description : ' Previous Docker version for MarkLogic upgrade tests. (e.g. 10.0-10.2-centos-1.1.2) Has to correspond with dockerImageType.' , trim : true )
183
- choice(name : ' K8_VERSION' , choices : ' v1.29.6 \n v1.30.2 \n v1.28.11 \n v1.27.15 \n v1.26.15\n v1.25.16' , description : ' Test Kubernetes version.' )
189
+ choice(name : ' K8_VERSION' , choices : ' v1.31.7 \n v1.32.3 \n v1. 30.11 \n v1.29.15 \n v1. 28.15 \n v1.27.16 \n v1.26.15\n v1.25.16' , description : ' Test Kubernetes version.' )
184
190
booleanParam(name : ' KUBERNETES_TESTS' , defaultValue : true , description : ' Run kubernetes tests' )
185
191
string(name : ' KUBERNETES_TEST_SELECTION' , defaultValue : ' ...' , description : ' Pick one test to run. (e.g. tls_test.go) ... will run all tests.' , trim : true )
186
192
booleanParam(name : ' HC_TESTS' , defaultValue : false , description : ' Run Hub Central E2E UI tests (takes about 3 hours)' )
@@ -250,22 +256,25 @@ pipeline {
250
256
sh '''
251
257
sudo sysctl -w vm.nr_hugepages=0
252
258
minikube delete --all --purge
253
- docker rm -f $(docker ps -a -q) || true
254
- docker system prune --force --filter "until=720h"
255
- docker volume prune --force
256
- docker image prune --force --all
257
- sudo rm -rf /space/. minikube /space/go /space/.kube-config
259
+ docker stop $(docker ps -a -q) || true
260
+ docker system prune --force --all
261
+ docker volume prune --force --all
262
+ docker system df
263
+ sudo rm -rf /space/minikube/ /space/go /space/.kube-config
258
264
'''
259
265
sh " rm -rf $WORKSPACE /test/test_results/"
260
266
}
261
267
success {
262
- resultNotification(' BUILD SUCCESS ✅ ' )
268
+ resultNotification(' ✅ Success ' )
263
269
}
264
270
failure {
265
- resultNotification(' BUILD ERROR ❌ ' )
271
+ resultNotification(' ❌ Failure ' )
266
272
}
267
273
unstable {
268
- resultNotification(' BUILD UNSTABLE ❌' )
274
+ resultNotification(' ⚠️ Unstable' )
275
+ }
276
+ aborted {
277
+ resultNotification(' 🚫 Aborted' )
269
278
}
270
279
}
271
280
}
0 commit comments