blob: 4a2491834b740d4ecdefca584d3bd1241caae6a7 [file] [log] [blame]
Jakub Josef51351cd2018-03-13 17:25:59 +01001/**
2 * Parent pipeline for running customer's models
3 *
4 * Params:
5 * CUSTOMERS - Comma-separated list of customer's names
6 */
7def common = new com.mirantis.mk.Common()
8
9timeout(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 Josef9bd79b42018-03-13 17:30:12 +010016 def modelName = customerList[i]
17 common.infoMsg("Test of ${modelName} starts")
18 build job: "test-salt-model-customer-${modelName}"
Jakub Josef51351cd2018-03-13 17:25:59 +010019 // 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 Josef9bd79b42018-03-13 17:30:12 +010022 // [$class: 'StringParameterValue', name: 'CLUSTER_NAME', value: modelName],
Jakub Josef51351cd2018-03-13 17:25:59 +010023 // [$class: 'StringParameterValue', name: 'NODE_TARGET', value: testTarget],
24 // [$class: 'StringParameterValue', name: 'FORMULAS_SOURCE', value: formulasSource]
azvyagintsev1bcadc42018-10-05 20:13:15 +030025 // [$class: 'StringParameterValue', name: 'DISTRIB_REVISION', value: distribRevision],
Jakub Josef51351cd2018-03-13 17:25:59 +010026 // [$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 Josef9bd79b42018-03-13 17:30:12 +010042 common.sendNotification(currentBuild.result, "", ["slack"])
Jakub Josef51351cd2018-03-13 17:25:59 +010043 }
44 }
45}
46