Jakub Josef | 51351cd | 2018-03-13 17:25:59 +0100 | [diff] [blame] | 1 | /** |
| 2 | * Parent pipeline for running customer's models |
| 3 | * |
| 4 | * Params: |
| 5 | * CUSTOMERS - Comma-separated list of customer's names |
| 6 | */ |
| 7 | def common = new com.mirantis.mk.Common() |
| 8 | |
| 9 | timeout(time: 12, unit: 'HOURS') { |
| 10 | node() { |
| 11 | try { |
| 12 | stage("Run customer's salt models tests") { |
| 13 | if(common.validInputParam("CUSTOMERS")){ |
| 14 | def customerList = CUSTOMERS.tokenize(",").collect{it.trim()} |
| 15 | for(int i=0; i<customerList.size(); i++){ |
Jakub Josef | 9bd79b4 | 2018-03-13 17:30:12 +0100 | [diff] [blame] | 16 | def modelName = customerList[i] |
| 17 | common.infoMsg("Test of ${modelName} starts") |
| 18 | build job: "test-salt-model-customer-${modelName}" |
Jakub Josef | 51351cd | 2018-03-13 17:25:59 +0100 | [diff] [blame] | 19 | // build job: "test-salt-model-customer-${customerList[i]}", parameters: [ |
| 20 | // [$class: 'StringParameterValue', name: 'DEFAULT_GIT_URL', value: defaultGitUrl], |
| 21 | // [$class: 'StringParameterValue', name: 'DEFAULT_GIT_REF', value: defaultGitRef], |
Jakub Josef | 9bd79b4 | 2018-03-13 17:30:12 +0100 | [diff] [blame] | 22 | // [$class: 'StringParameterValue', name: 'CLUSTER_NAME', value: modelName], |
Jakub Josef | 51351cd | 2018-03-13 17:25:59 +0100 | [diff] [blame] | 23 | // [$class: 'StringParameterValue', name: 'NODE_TARGET', value: testTarget], |
| 24 | // [$class: 'StringParameterValue', name: 'FORMULAS_SOURCE', value: formulasSource] |
azvyagintsev | 1bcadc4 | 2018-10-05 20:13:15 +0300 | [diff] [blame] | 25 | // [$class: 'StringParameterValue', name: 'DISTRIB_REVISION', value: distribRevision], |
Jakub Josef | 51351cd | 2018-03-13 17:25:59 +0100 | [diff] [blame] | 26 | // [$class: 'StringParameterValue', name: 'CREDENTIALS_ID', value: CREDENTIALS_ID], |
| 27 | // [$class: 'StringParameterValue', name: 'SYSTEM_GIT_URL', value: SYSTEM_GIT_URL], |
| 28 | // [$class: 'StringParameterValue', name: 'MAX_CPU_PER_JOB', value: MAX_CPU_PER_JOB], |
| 29 | // [$class: 'StringParameterValue', name: 'SYSTEM_GIT_REF', value: SYSTEM_GIT_REF], |
| 30 | // [$class: 'BooleanParameterValue', name: 'LEGACY_TEST_MODE', value: LEGACY_TEST_MODE.toBoolean()], |
| 31 | // [$class: 'BooleanParameterValue', name: 'RECLASS_IGNORE_CLASS_NOTFOUND', value: RECLASS_IGNORE_CLASS_NOTFOUND.toBoolean()] |
| 32 | // ] |
| 33 | } |
| 34 | } |
| 35 | } |
| 36 | } catch (Throwable e) { |
| 37 | // If there was an error or exception thrown, the build failed |
| 38 | currentBuild.result = "FAILURE" |
| 39 | currentBuild.description = currentBuild.description ? e.message + " " + currentBuild.description : e.message |
| 40 | throw e |
| 41 | } finally { |
Jakub Josef | 9bd79b4 | 2018-03-13 17:30:12 +0100 | [diff] [blame] | 42 | common.sendNotification(currentBuild.result, "", ["slack"]) |
Jakub Josef | 51351cd | 2018-03-13 17:25:59 +0100 | [diff] [blame] | 43 | } |
| 44 | } |
| 45 | } |
| 46 | |