blob: c0750c0c2367302724874fa2ba36d81030e05a88 [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++){
16 common.infoMsg("Test of ${clusterName} starts")
17 build job: "test-salt-model-customer-${customerList[i]}"
18 // build job: "test-salt-model-customer-${customerList[i]}", parameters: [
19 // [$class: 'StringParameterValue', name: 'DEFAULT_GIT_URL', value: defaultGitUrl],
20 // [$class: 'StringParameterValue', name: 'DEFAULT_GIT_REF', value: defaultGitRef],
21 // [$class: 'StringParameterValue', name: 'CLUSTER_NAME', value: clusterName],
22 // [$class: 'StringParameterValue', name: 'NODE_TARGET', value: testTarget],
23 // [$class: 'StringParameterValue', name: 'FORMULAS_SOURCE', value: formulasSource]
24 // [$class: 'StringParameterValue', name: 'EXTRA_FORMULAS', value: EXTRA_FORMULAS],
25 // [$class: 'StringParameterValue', name: 'FORMULAS_REVISION', value: FORMULAS_REVISION],
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 {
42 common.sendNotification(currentBuild.result,"",["slack"])
43 def _extra_descr = "${SOURCE}=>${TARGET}:\n${COMPONENTS} ${packages}"
44 currentBuild.description = currentBuild.description ? _extra_descr + " " + currentBuild.description : _extra_descr
45 }
46 }
47}
48