@@ -115,11 +115,7 @@ void resultNotification(message) {
115115
116116void lint () {
117117 sh '''
118- # Added to fix 'Context loading failed error'
119- go get ./...
120- echo Installing golangci-lint
121- curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.50.0
122- make lint saveOutput=true path=./bin/
118+ make lint saveOutput=true
123119 '''
124120
125121 LINT_OUTPUT = sh(returnStdout : true , script : ' echo helm template lint output: ;cat helm-lint-output.txt ;echo all tests lint output: ;cat test-lint-output.txt' ). trim()
@@ -139,10 +135,23 @@ void pullImage() {
139135 sh """
140136 echo "\$ docker_password" | docker login --username \$ docker_user --password-stdin ${ dockerRegistry}
141137 docker pull ${ dockerRepository} :${ dockerVersion}
138+ docker pull ${ dockerRepository} :${ dockerVersion}
139+ docker pull ${ dockerRepository} :${ prevDockerVersion}
142140 """
143141 }
144142}
145143
144+ String getVersionDiv (mlVersion ) {
145+ switch (mlVersion) {
146+ case ' 10.0' :
147+ return ' -'
148+ case ' 9.0' :
149+ return ' -'
150+ default :
151+ return ' .'
152+ }
153+ }
154+
146155pipeline {
147156 agent {
148157 label {
@@ -161,13 +170,19 @@ pipeline {
161170 timeStamp = sh(returnStdout : true , script : " date +%Y%m%d -d '-5 hours'" ). trim()
162171 dockerRegistry = ' ml-docker-dev.marklogic.com'
163172 dockerRepository = " ${ dockerRegistry} /marklogic/marklogic-server-centos"
164- dockerVersion = " ${ ML_VERSION} -${ timeStamp} -centos-1.0.0"
173+ dockerVerDivider = getVersionDiv(params. ML_VERSION )
174+ prevDockerVerDivider = getVersionDiv(params. PREV_ML_VERSION )
175+ dockerVersion = " ${ ML_VERSION}${ dockerVerDivider}${ timeStamp} -centos-${ dockerReleaseVer} "
176+ prevDockerVersion = " ${ PREV_ML_VERSION}${ prevDockerVerDivider}${ timeStamp} -centos-${ prevDockerReleaseVer} "
165177 }
166178
167179 parameters {
168180 string(name : ' emailList' , defaultValue : emailList, description : ' List of email for build notification' , trim : true )
169- choice(name : ' ML_VERSION' , choices : ' 10 .0\n 11 .0\n 9.0' , description : ' MarkLogic version. used to pick appropriate docker image' )
181+ choice(name : ' ML_VERSION' , choices : ' 11 .0\n 12.0 \n 10 .0\n 9.0' , description : ' MarkLogic version. used to pick appropriate docker image' )
170182 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 )
171186 }
172187
173188 stages {
@@ -196,7 +211,7 @@ pipeline {
196211 steps {
197212 sh """
198213 export MINIKUBE_HOME=/space;
199- make test dockerImage=${ dockerRepository} :${ dockerVersion} saveOutput=true
214+ make test dockerImage=${ dockerRepository} :${ dockerVersion} prevDockerImage= ${ dockerRepository } : ${ prevDockerVersion } saveOutput=true
200215 """
201216 }
202217 }
0 commit comments