5
5
6
6
import groovy.json.JsonSlurperClassic
7
7
8
- emailList
= ' [email protected] , irosenba@marklogic .com, sumanth.ravipati@marklogic .com, peng.zhou@marklogic .com, fayez.saliba@marklogic .com, barkha.choithani@marklogic .com'
9
- gitCredID = ' 550650ab-ee92-4d31-a3f4-91a11d5388a3 '
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
+ gitCredID = ' marklogic-builder-github '
10
10
JIRA_ID = ' '
11
- JIRA_ID_PATTERN = / CLD-\d {3,4}/
11
+ JIRA_ID_PATTERN = / (?i)( CLD|DEVO|QAINF|BUG|DBI) -\d {3,4}/
12
12
LINT_OUTPUT = ' '
13
13
SCAN_OUTPUT = ' '
14
14
IMAGE_INFO = 0
@@ -31,7 +31,7 @@ void preBuildCheck() {
31
31
if (env. CHANGE_ID ) {
32
32
if (prDraftCheck()) { sh ' exit 1' }
33
33
if (getReviewState(). equalsIgnoreCase(' CHANGES_REQUESTED' )) {
34
- println ( reviewState)
34
+ echo ' PR changes requested. ( ' + reviewState + ' ) Aborting. '
35
35
sh ' exit 1'
36
36
}
37
37
}
@@ -51,11 +51,11 @@ def extractJiraID() {
51
51
match = env. GIT_BRANCH =~ JIRA_ID_PATTERN
52
52
}
53
53
else {
54
- echo ' Warning: Jira ticket number not detected .'
54
+ echo ' Warning: No Git title or branch available .'
55
55
return ' '
56
56
}
57
57
try {
58
- return match[0 ]
58
+ return match[0 ][ 0 ]
59
59
} catch (any) {
60
60
echo ' Warning: Jira ticket number not detected.'
61
61
return ' '
@@ -127,11 +127,11 @@ void lint() {
127
127
128
128
void publishTestResults () {
129
129
junit allowEmptyResults :true , testResults : ' **/test/test_results/*.xml'
130
- publishHTML allowMissing : true , alwaysLinkToLastBuild : true , keepAll : true , reportDir : ' test/test_results' , reportFiles : ' report.html ' , reportName : ' Kubernetes Tests Report ' , reportTitles : ' '
130
+ archiveArtifacts artifacts : ' **/ test/test_results/*.xml ' , allowEmptyArchive : true
131
131
}
132
132
133
133
void pullImage () {
134
- withCredentials([usernamePassword(credentialsId : ' 8c2e0b38-9e97-4953-aa60-f2851bb70cc8 ' , passwordVariable : ' docker_password' , usernameVariable : ' docker_user' )]) {
134
+ withCredentials([usernamePassword(credentialsId : ' builder-credentials-artifactory ' , passwordVariable : ' docker_password' , usernameVariable : ' docker_user' )]) {
135
135
sh """
136
136
echo "\$ docker_password" | docker login --username \$ docker_user --password-stdin ${ dockerRegistry}
137
137
docker pull ${ dockerRepository} :${ dockerVersion}
@@ -167,8 +167,9 @@ pipeline {
167
167
parameterizedCron( env. BRANCH_NAME == ' develop' ? ''' 00 04 * * *''' : ' ' )
168
168
}
169
169
environment {
170
- timeStamp = sh(returnStdout : true , script : " date +%Y%m%d -d '-5 hours'" ). trim()
171
- dockerRegistry = ' ml-docker-dev.marklogic.com'
170
+ // timeStamp = sh(returnStdout: true, script: "date +%Y%m%d -d '-5 hours'").trim()
171
+ timeStamp = ' nightly'
172
+ dockerRegistry = ' ml-docker-db-dev-tierpoint.bed-artifactory.bedford.progress.com'
172
173
dockerRepository = " ${ dockerRegistry} /marklogic/marklogic-server-centos"
173
174
dockerVerDivider = getVersionDiv(params. ML_VERSION )
174
175
prevDockerVerDivider = getVersionDiv(params. PREV_ML_VERSION )
@@ -178,11 +179,12 @@ pipeline {
178
179
179
180
parameters {
180
181
string(name : ' emailList' , defaultValue : emailList, description : ' List of email for build notification' , trim : true )
181
- choice(name : ' ML_VERSION' , choices : ' 11.1 \n 12.0\n 10.0 \n 9 .0' , description : ' MarkLogic version. used to pick appropriate docker image' )
182
+ choice(name : ' ML_VERSION' , choices : ' 11.2 \n 12.0\n 10.0' , description : ' MarkLogic version. used to pick appropriate docker image' )
182
183
booleanParam(name : ' KUBERNETES_TESTS' , defaultValue : true , description : ' Run kubernetes tests' )
183
- string(name : ' dockerReleaseVer' , defaultValue : ' 1.0.2' , description : ' Current Docker version. (e.g. 1.0.1)' , trim : true )
184
- choice(name : ' PREV_ML_VERSION' , choices : ' 10.0\n 9.0' , description : ' Previous MarkLogic version for MarkLogic upgrade tests' )
185
- string(name : ' prevDockerReleaseVer' , defaultValue : ' 1.0.2' , description : ' Previous Docker version for MarkLogic upgrade tests. (e.g. 1.0.1)' , trim : true )
184
+ booleanParam(name : ' HC_TESTS' , defaultValue : false , description : ' Run Hub Central E2E UI tests (takes about 3 hours)' )
185
+ string(name : ' dockerReleaseVer' , defaultValue : ' 1.1.1' , description : ' Current Docker version. (e.g. 1.0.1)' , trim : true )
186
+ choice(name : ' PREV_ML_VERSION' , choices : ' 10.0\n 9.0\n 11.2' , description : ' Previous MarkLogic version for MarkLogic upgrade tests' )
187
+ string(name : ' prevDockerReleaseVer' , defaultValue : ' 1.1.1' , description : ' Previous Docker version for MarkLogic upgrade tests. (e.g. 1.0.1)' , trim : true )
186
188
choice(name : ' K8_VERSION' , choices : ' v1.25.8\n v1.26.3\n v1.24.12\n v1.23.17' , description : ' Test Kubernetes version. (e.g. v1.25.8)' )
187
189
}
188
190
@@ -211,22 +213,32 @@ pipeline {
211
213
}
212
214
steps {
213
215
sh """
214
- export MINIKUBE_HOME=/space;
215
- make test dockerImage=${ dockerRepository} :${ dockerVersion} prevDockerImage=${ dockerRepository} :${ prevDockerVersion} kubernetesVersion=${ params.K8_VERSION} saveOutput=true
216
+ export MINIKUBE_HOME=/space; export KUBECONFIG=/space/.kube-config; make test dockerImage=${ dockerRepository} :${ dockerVersion} prevDockerImage=${ dockerRepository} :${ prevDockerVersion} kubernetesVersion=${ params.K8_VERSION} saveOutput=true minikubeMemory=20gb
217
+ """
218
+ }
219
+ }
220
+ stage(' Kubernetes-Run-HC-Tests' ) {
221
+ when {
222
+ expression { return params. HC_TESTS }
223
+ }
224
+ steps {
225
+ sh """
226
+ export MINIKUBE_HOME=/space; export KUBECONFIG=/space/.kube-config; make hc-test dockerImage=${ dockerRepository} :${ dockerVersion} kubernetesVersion=${ params.K8_VERSION} minikubeMemory=20gb
216
227
"""
217
228
}
218
229
}
219
230
}
220
231
221
232
post {
222
233
always {
234
+ publishTestResults()
223
235
sh '''
224
236
docker system prune --force --filter "until=720h"
225
237
docker volume prune --force
226
238
docker image prune --force --all
227
- minikube delete --all --purge
239
+ export MINIKUBE_HOME=/space; export KUBECONFIG=/space/.kube-config; minikube delete --all --purge
228
240
'''
229
- publishTestResults()
241
+ sh " rm -rf $W ORKSPACE /test/test_results/ "
230
242
}
231
243
success {
232
244
resultNotification(' BUILD SUCCESS ✅' )
@@ -238,4 +250,4 @@ pipeline {
238
250
resultNotification(' BUILD UNSTABLE ❌' )
239
251
}
240
252
}
241
- }
253
+ }
0 commit comments