blob: 559b891f34bf98b44e8c40625fa986c338baa10b [file] [log] [blame]
Filip Pytlounfcce97c2017-03-07 14:06:07 +01001def gerrit = new com.mirantis.mk.Gerrit()
Filip Pytloun19376a82017-03-07 12:29:00 +01002
Filip Pytlounfcce97c2017-03-07 14:06:07 +01003def gerritCredentials
4try {
5 gerritCredentials = CREDENTIALS_ID
6} catch (MissingPropertyException e) {
7 gerritCredentials = "gerrit"
8}
9
10try {
11 stage("Checkout") {
12 node() {
13 gerrit.gerritPatchsetCheckout ([
14 credentialsId : gerritCredentials
15 ])
Filip Pytloun840a0842017-03-07 13:54:23 +010016 }
Filip Pytloun19376a82017-03-07 12:29:00 +010017 }
Filip Pytlounfcce97c2017-03-07 14:06:07 +010018
19 stage("Test") {
20 def branches = [:]
21 def testModels = TEST_MODELS.split(',')
22
23 for (int i = 0; i < testModels.size(); i++) {
24 def cluster = testModels[i]
25 branches["${cluster}"] = {
26 build job: "test-salt-model-${cluster}", parameters: [
27 [$class: 'StringParameterValue', name: 'RECLASS_SYSTEM_GIT_URL', value: "${GERRIT_SCHEME}://${GERRIT_NAME}@${GERRIT_HOST}:${GERRIT_PORT}/${GERRIT_PROJECT}.git"],
28 [$class: 'StringParameterValue', name: 'RECLASS_SYSTEM_GIT_REF', value: GERRIT_REFSPEC]
29 ]
30 }
31 }
32 parallel branches
33 }
34} catch (Throwable e) {
35 // If there was an error or exception thrown, the build failed
36 currentBuild.result = "FAILURE"
37 throw e
38} finally {
39 common.sendNotification(currentBuild.result,"",["slack"])
Filip Pytloun19376a82017-03-07 12:29:00 +010040}