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