Filip Pytloun | fcce97c | 2017-03-07 14:06:07 +0100 | [diff] [blame^] | 1 | def gerrit = new com.mirantis.mk.Gerrit() |
Filip Pytloun | 19376a8 | 2017-03-07 12:29:00 +0100 | [diff] [blame] | 2 | |
Filip Pytloun | fcce97c | 2017-03-07 14:06:07 +0100 | [diff] [blame^] | 3 | def gerritCredentials |
| 4 | try { |
| 5 | gerritCredentials = CREDENTIALS_ID |
| 6 | } catch (MissingPropertyException e) { |
| 7 | gerritCredentials = "gerrit" |
| 8 | } |
| 9 | |
| 10 | try { |
| 11 | stage("Checkout") { |
| 12 | node() { |
| 13 | gerrit.gerritPatchsetCheckout ([ |
| 14 | credentialsId : gerritCredentials |
| 15 | ]) |
Filip Pytloun | 840a084 | 2017-03-07 13:54:23 +0100 | [diff] [blame] | 16 | } |
Filip Pytloun | 19376a8 | 2017-03-07 12:29:00 +0100 | [diff] [blame] | 17 | } |
Filip Pytloun | fcce97c | 2017-03-07 14:06:07 +0100 | [diff] [blame^] | 18 | |
| 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 Pytloun | 19376a8 | 2017-03-07 12:29:00 +0100 | [diff] [blame] | 40 | } |