blob: 57c0e38c0f1214b17c18af311f60d1f8c69f687b [file] [log] [blame]
Ales Komarek24097402017-05-22 16:28:10 +02001/**
2 *
3 * Launch heat/cloudformation stack
4 *
5 * Expected parameters:
6 * STACK_NAME Infrastructure stack name
7 * STACK_TEMPLATE Stack HOT/CFN template
8 * STACK_TYPE Deploy OpenStack/AWS [heat/aws]
9 *
10 * STACK_TEMPLATE_URL URL to git repo with stack templates
11 * STACK_TEMPLATE_CREDENTIALS Credentials to the templates repo
12 * STACK_TEMPLATE_BRANCH Stack templates repo branch
13 *
14 * STACK_DELETE Delete stack when finished (bool)
15 * STACK_REUSE Reuse existing stack (don't create one)
16 * STACK_INSTALL What should be installed (k8s, openstack, ...)
17 * STACK_TEST Run tests (bool)
18 * STACK_CLEANUP_JOB Name of job for deleting stack
19 *
Tomáš Kukrál74f92862017-06-05 19:18:43 +020020 * STACK_COMPUTE_COUNT Number of compute nodes to launch
21 *
Ales Komarek24097402017-05-22 16:28:10 +020022 * AWS_STACK_REGION CloudFormation AWS region
23 * AWS_API_CREDENTIALS AWS Access key ID with AWS secret access key
Tomáš Kukrál7a8a4fa2017-05-25 14:54:24 +020024 * AWS_SSH_KEY AWS key pair name (used for SSH access)
Ales Komarek24097402017-05-22 16:28:10 +020025 *
26 * HEAT_STACK_ENVIRONMENT Heat stack environmental parameters
27 * HEAT_STACK_ZONE Heat stack availability zone
28 * HEAT_STACK_PUBLIC_NET Heat stack floating IP pool
29 * OPENSTACK_API_URL OpenStack API address
30 * OPENSTACK_API_CREDENTIALS Credentials to the OpenStack API
31 * OPENSTACK_API_PROJECT OpenStack project to connect to
32 * OPENSTACK_API_CLIENT Versions of OpenStack python clients
33 * OPENSTACK_API_VERSION Version of the OpenStack API (2/3)
Tomáš Kukrál5c2ec132017-07-26 09:57:27 +020034
Ales Komarek24097402017-05-22 16:28:10 +020035 * SALT_MASTER_CREDENTIALS Credentials to the Salt API
Tomáš Kukrál5c2ec132017-07-26 09:57:27 +020036 * required for STACK_TYPE=NONE or empty string
Ales Komarek24097402017-05-22 16:28:10 +020037 * SALT_MASTER_URL URL of Salt master
Tomáš Kukrál5c2ec132017-07-26 09:57:27 +020038
39 * Test settings:
40 * TEST_K8S_API_SERVER Kubernetes API address
41 * TEST_K8S_CONFORMANCE_IMAGE Path to docker image with conformance e2e tests
Ales Komarek24097402017-05-22 16:28:10 +020042 *
Tomáš Kukrál5c2ec132017-07-26 09:57:27 +020043 * TEST_DOCKER_INSTALL Install docker on the target if true
44 * TEST_TEMPEST_IMAGE Tempest image link
45 * TEST_TEMPEST_PATTERN If not false, run tests matched to pattern only
46 * TEST_TEMPEST_TARGET Salt target for tempest node
Ales Komarek24097402017-05-22 16:28:10 +020047 *
Tomáš Kukrál5c2ec132017-07-26 09:57:27 +020048 * optional parameters for overwriting soft params
49 * SALT_OVERRIDES YAML with overrides for Salt deployment
Ales Komarek24097402017-05-22 16:28:10 +020050 *
51 */
52common = new com.mirantis.mk.Common()
53git = new com.mirantis.mk.Git()
54openstack = new com.mirantis.mk.Openstack()
Tomáš Kukrál7a8a4fa2017-05-25 14:54:24 +020055aws = new com.mirantis.mk.Aws()
Ales Komarek24097402017-05-22 16:28:10 +020056orchestrate = new com.mirantis.mk.Orchestrate()
57salt = new com.mirantis.mk.Salt()
58test = new com.mirantis.mk.Test()
59
60_MAX_PERMITTED_STACKS = 2
61overwriteFile = "/srv/salt/reclass/classes/cluster/override.yml"
62
Tomáš Kukrála1d86b82017-07-10 17:24:01 +020063// Define global variables
Tomáš Kukrál31414a22017-06-09 14:17:53 +020064def saltMaster
Tomáš Kukrála1d86b82017-07-10 17:24:01 +020065def venv
Tomáš Kukrálbc4be252017-06-06 11:28:40 +020066
Tomáš Kukrálb19bdda2017-06-13 17:09:43 +020067if (STACK_TYPE == 'aws') {
Tomáš Kukrála1d86b82017-07-10 17:24:01 +020068 def aws_env_vars
Tomáš Kukrálb19bdda2017-06-13 17:09:43 +020069}
70
Ales Komarek24097402017-05-22 16:28:10 +020071timestamps {
72 node {
73 try {
Tomáš Kukrála1d86b82017-07-10 17:24:01 +020074 // Set build-specific variables
75 venv = "${env.WORKSPACE}/venv"
76
Ales Komarek24097402017-05-22 16:28:10 +020077 //
78 // Prepare machines
79 //
80 stage ('Create infrastructure') {
81
82 if (STACK_TYPE == 'heat') {
83 // value defaults
84 def openstackCloud
85 def openstackVersion = OPENSTACK_API_CLIENT ? OPENSTACK_API_CLIENT : 'liberty'
Ales Komarek24097402017-05-22 16:28:10 +020086
87 if (STACK_REUSE.toBoolean() == true && STACK_NAME == '') {
88 error("If you want to reuse existing stack you need to provide it's name")
89 }
90
91 if (STACK_REUSE.toBoolean() == false) {
92 // Don't allow to set custom heat stack name
93 wrap([$class: 'BuildUser']) {
94 if (env.BUILD_USER_ID) {
95 STACK_NAME = "${env.BUILD_USER_ID}-${JOB_NAME}-${BUILD_NUMBER}"
96 } else {
97 STACK_NAME = "jenkins-${JOB_NAME}-${BUILD_NUMBER}"
98 }
99 currentBuild.description = STACK_NAME
100 }
101 }
102
103 // set description
104 currentBuild.description = "${STACK_NAME}"
105
106 // get templates
107 git.checkoutGitRepository('template', STACK_TEMPLATE_URL, STACK_TEMPLATE_BRANCH, STACK_TEMPLATE_CREDENTIALS)
108
109 // create openstack env
Tomáš Kukrál8fa9b672017-07-10 14:22:19 +0200110 openstack.setupOpenstackVirtualenv(venv, openstackVersion)
Ales Komarek24097402017-05-22 16:28:10 +0200111 openstackCloud = openstack.createOpenstackEnv(OPENSTACK_API_URL, OPENSTACK_API_CREDENTIALS, OPENSTACK_API_PROJECT)
Tomáš Kukrál8fa9b672017-07-10 14:22:19 +0200112 openstack.getKeystoneToken(openstackCloud, venv)
Ales Komarek24097402017-05-22 16:28:10 +0200113 //
114 // Verify possibility of create stack for given user and stack type
115 //
116 wrap([$class: 'BuildUser']) {
117 if (env.BUILD_USER_ID && !env.BUILD_USER_ID.equals("jenkins") && !STACK_REUSE.toBoolean()) {
Tomáš Kukrál8fa9b672017-07-10 14:22:19 +0200118 def existingStacks = openstack.getStacksForNameContains(openstackCloud, "${env.BUILD_USER_ID}-${JOB_NAME}", venv)
Ales Komarek24097402017-05-22 16:28:10 +0200119 if(existingStacks.size() >= _MAX_PERMITTED_STACKS){
120 STACK_DELETE = "false"
121 throw new Exception("You cannot create new stack, you already have ${_MAX_PERMITTED_STACKS} stacks of this type (${JOB_NAME}). \nStack names: ${existingStacks}")
122 }
123 }
124 }
125 // launch stack
126 if (STACK_REUSE.toBoolean() == false) {
127 stage('Launch new Heat stack') {
128 // create stack
129 envParams = [
Ales Komarek4f5e5f82017-07-25 15:48:53 +0200130 'cluster_zone': HEAT_STACK_ZONE,
131 'cluster_public_net': HEAT_STACK_PUBLIC_NET
Ales Komarek24097402017-05-22 16:28:10 +0200132 ]
Tomáš Kukrál8fa9b672017-07-10 14:22:19 +0200133 openstack.createHeatStack(openstackCloud, STACK_NAME, STACK_TEMPLATE, envParams, HEAT_STACK_ENVIRONMENT, venv, false)
Ales Komarek24097402017-05-22 16:28:10 +0200134 }
135 }
136
137 // get SALT_MASTER_URL
Tomáš Kukrál8fa9b672017-07-10 14:22:19 +0200138 saltMasterHost = openstack.getHeatStackOutputParam(openstackCloud, STACK_NAME, 'salt_master_ip', venv)
Tomáš Kukrál7a8a4fa2017-05-25 14:54:24 +0200139 currentBuild.description = "${STACK_NAME} ${saltMasterHost}"
Ales Komarek24097402017-05-22 16:28:10 +0200140
141 SALT_MASTER_URL = "http://${saltMasterHost}:6969"
Tomáš Kukrál7a8a4fa2017-05-25 14:54:24 +0200142 } else if (STACK_TYPE == 'aws') {
Ales Komarek24097402017-05-22 16:28:10 +0200143
Tomáš Kukrál9af83062017-07-13 10:00:54 +0200144 // setup environment
145 aws.setupVirtualEnv(venv)
146
Tomáš Kukrála1d86b82017-07-10 17:24:01 +0200147 // set aws_env_vars
148 aws_env_vars = aws.getEnvVars(AWS_API_CREDENTIALS, AWS_STACK_REGION)
Tomáš Kukrál7a8a4fa2017-05-25 14:54:24 +0200149
150 if (STACK_REUSE.toBoolean() == true && STACK_NAME == '') {
151 error("If you want to reuse existing stack you need to provide it's name")
152 }
153
154 if (STACK_REUSE.toBoolean() == false) {
155 // Don't allow to set custom stack name
156 wrap([$class: 'BuildUser']) {
157 if (env.BUILD_USER_ID) {
158 STACK_NAME = "${env.BUILD_USER_ID}-${JOB_NAME}-${BUILD_NUMBER}"
159 } else {
160 STACK_NAME = "jenkins-${JOB_NAME}-${BUILD_NUMBER}"
161 }
Tomáš Kukrál7a8a4fa2017-05-25 14:54:24 +0200162 }
Tomáš Kukráldbf8ca82017-05-25 15:13:20 +0200163
164 // no underscore in STACK_NAME
165 STACK_NAME = STACK_NAME.replaceAll('_', '-')
Tomáš Kukrál7a8a4fa2017-05-25 14:54:24 +0200166 }
167
168 // set description
Tomáš Kukráldbf8ca82017-05-25 15:13:20 +0200169 currentBuild.description = STACK_NAME
Tomáš Kukrál7a8a4fa2017-05-25 14:54:24 +0200170
Tomáš Kukrál7a8a4fa2017-05-25 14:54:24 +0200171 if (STACK_REUSE.toBoolean() == false) {
172 // get templates
173 git.checkoutGitRepository('template', STACK_TEMPLATE_URL, STACK_TEMPLATE_BRANCH, STACK_TEMPLATE_CREDENTIALS)
174
Tomáš Kukrál7a8a4fa2017-05-25 14:54:24 +0200175 // start stack
Tomáš Kukrálad79d322017-06-05 15:40:14 +0200176 def stack_params = [
177 "ParameterKey=KeyName,ParameterValue=" + AWS_SSH_KEY,
178 "ParameterKey=CmpNodeCount,ParameterValue=" + STACK_COMPUTE_COUNT
179 ]
Tomáš Kukráldbb58402017-06-02 07:08:53 +0200180 def template_file = 'cfn/' + STACK_TEMPLATE + '.yml'
Tomáš Kukrála1d86b82017-07-10 17:24:01 +0200181 aws.createStack(venv, aws_env_vars, template_file, STACK_NAME, stack_params)
Tomáš Kukrál7a8a4fa2017-05-25 14:54:24 +0200182 }
183
184 // wait for stack to be ready
Tomáš Kukrála1d86b82017-07-10 17:24:01 +0200185 aws.waitForStatus(venv, aws_env_vars, STACK_NAME, 'CREATE_COMPLETE')
Tomáš Kukrál7a8a4fa2017-05-25 14:54:24 +0200186
187 // get outputs
Tomáš Kukrála1d86b82017-07-10 17:24:01 +0200188 saltMasterHost = aws.getOutputs(venv, aws_env_vars, STACK_NAME, 'SaltMasterIP')
Tomáš Kukrál7a8a4fa2017-05-25 14:54:24 +0200189 currentBuild.description = "${STACK_NAME} ${saltMasterHost}"
Ales Komarek24097402017-05-22 16:28:10 +0200190 SALT_MASTER_URL = "http://${saltMasterHost}:6969"
Ales Komarek24097402017-05-22 16:28:10 +0200191
Tomáš Kukrál7a8a4fa2017-05-25 14:54:24 +0200192 } else {
193 throw new Exception("STACK_TYPE ${STACK_TYPE} is not supported")
194 }
Ales Komarek24097402017-05-22 16:28:10 +0200195
Tomáš Kukrál20707642017-06-09 13:35:13 +0200196 // Connect to Salt master
Ales Komarek24097402017-05-22 16:28:10 +0200197 saltMaster = salt.connection(SALT_MASTER_URL, SALT_MASTER_CREDENTIALS)
198 }
199
200 //
201 // Install
202 //
203
204 if (common.checkContains('STACK_INSTALL', 'core')) {
205 stage('Install core infrastructure') {
206 orchestrate.installFoundationInfra(saltMaster)
207
208 if (common.checkContains('STACK_INSTALL', 'kvm')) {
209 orchestrate.installInfraKvm(saltMaster)
210 orchestrate.installFoundationInfra(saltMaster)
211 }
212
213 orchestrate.validateFoundationInfra(saltMaster)
214 }
215 }
216
Matthew Mosesohn30afef92017-07-19 16:49:45 +0300217 // Set up override params
218 if (env.getEnvironment().containsKey('SALT_OVERRIDES')) {
219 stage('Set Salt overrides') {
220 salt.setSaltOverrides(saltMaster, SALT_OVERRIDES)
221 }
222 }
223
224
Ales Komarek24097402017-05-22 16:28:10 +0200225 // install k8s
226 if (common.checkContains('STACK_INSTALL', 'k8s')) {
vrovachev7be1e962017-07-05 13:28:26 +0400227
Ales Komarek24097402017-05-22 16:28:10 +0200228 stage('Install Kubernetes infra') {
Tomáš Kukrál39c96cd2017-07-11 10:14:13 +0200229 if (STACK_TYPE == 'aws') {
230 // configure kubernetes_control_address - save loadbalancer
231 def kubernetes_control_address = aws.getOutputs(venv, aws_env_vars, STACK_NAME, 'ControlLoadBalancer')
232 print(kubernetes_control_address)
233 salt.runSaltProcessStep(saltMaster, 'I@salt:master', 'reclass.cluster_meta_set', ['kubernetes_control_address', kubernetes_control_address], null, true)
234 }
Tomáš Kukrál4898be32017-06-19 09:54:15 +0200235 // ensure certificates are generated properly
236 salt.runSaltProcessStep(saltMaster, '*', 'saltutil.refresh_pillar', [], null, true)
237 salt.enforceState(saltMaster, '*', ['salt.minion.cert'], true)
238
Ales Komarek24097402017-05-22 16:28:10 +0200239 orchestrate.installKubernetesInfra(saltMaster)
240 }
241
vrovachev7be1e962017-07-05 13:28:26 +0400242 if (common.checkContains('STACK_INSTALL', 'contrail')) {
243 stage('Install Contrail for Kubernetes') {
244 orchestrate.installContrailNetwork(saltMaster)
vrovachev7be1e962017-07-05 13:28:26 +0400245 orchestrate.installKubernetesContrailCompute(saltMaster)
246 }
247 }
248
Ales Komarek24097402017-05-22 16:28:10 +0200249 stage('Install Kubernetes control') {
250
Ales Komarek24097402017-05-22 16:28:10 +0200251 orchestrate.installKubernetesControl(saltMaster)
252 }
253
Tomáš Kukrál74f92862017-06-05 19:18:43 +0200254 stage('Scale Kubernetes computes') {
Tomáš Kukrálb9a7d6f2017-06-07 14:05:31 +0200255 if (STACK_COMPUTE_COUNT > 0) {
256 if (STACK_TYPE == 'aws') {
Tomáš Kukrálb9a7d6f2017-06-07 14:05:31 +0200257 // get stack info
Tomáš Kukrála1d86b82017-07-10 17:24:01 +0200258 def scaling_group = aws.getOutputs(venv, aws_env_vars, STACK_NAME, 'ComputesScalingGroup')
Tomáš Kukrál74f92862017-06-05 19:18:43 +0200259
Tomáš Kukrálb9a7d6f2017-06-07 14:05:31 +0200260 //update autoscaling group
Tomáš Kukrála1d86b82017-07-10 17:24:01 +0200261 aws.updateAutoscalingGroup(venv, aws_env_vars, scaling_group, ["--desired-capacity " + STACK_COMPUTE_COUNT])
Tomáš Kukrál8130a562017-06-06 11:09:22 +0200262
Tomáš Kukrálb9a7d6f2017-06-07 14:05:31 +0200263 // wait for computes to boot up
Tomáš Kukrála1d86b82017-07-10 17:24:01 +0200264 aws.waitForAutoscalingInstances(venv, aws_env_vars, scaling_group)
Tomáš Kukrálf31a5912017-06-13 15:47:25 +0200265 sleep(60)
Tomáš Kukrálb9a7d6f2017-06-07 14:05:31 +0200266 }
267
268 orchestrate.installKubernetesCompute(saltMaster)
Tomáš Kukrál74f92862017-06-05 19:18:43 +0200269 }
Tomáš Kukrál74f92862017-06-05 19:18:43 +0200270 }
Ales Komarek24097402017-05-22 16:28:10 +0200271 }
272
273 // install openstack
274 if (common.checkContains('STACK_INSTALL', 'openstack')) {
275 // install Infra and control, tests, ...
276
277 stage('Install OpenStack infra') {
278 orchestrate.installOpenstackInfra(saltMaster)
279 }
280
281 stage('Install OpenStack control') {
282 orchestrate.installOpenstackControl(saltMaster)
283 }
284
285 stage('Install OpenStack network') {
286
287 if (common.checkContains('STACK_INSTALL', 'contrail')) {
288 orchestrate.installContrailNetwork(saltMaster)
289 } else if (common.checkContains('STACK_INSTALL', 'ovs')) {
290 orchestrate.installOpenstackNetwork(saltMaster)
291 }
292
293 salt.runSaltProcessStep(saltMaster, 'I@keystone:server', 'cmd.run', ['. /root/keystonerc; neutron net-list'])
294 salt.runSaltProcessStep(saltMaster, 'I@keystone:server', 'cmd.run', ['. /root/keystonerc; nova net-list'])
295 }
296
297 stage('Install OpenStack compute') {
298 orchestrate.installOpenstackCompute(saltMaster)
299
300 if (common.checkContains('STACK_INSTALL', 'contrail')) {
301 orchestrate.installContrailCompute(saltMaster)
302 }
303 }
304
305 }
306
307
Martin Polreich46971102017-07-11 12:56:40 +0200308 if (common.checkContains('STACK_INSTALL', 'sl-legacy')) {
309 stage('Install StackLight v1') {
310 orchestrate.installStacklightv1Control(saltMaster)
311 orchestrate.installStacklightv1Client(saltMaster)
312 }
313 }
314
Ales Komarek24097402017-05-22 16:28:10 +0200315 if (common.checkContains('STACK_INSTALL', 'stacklight')) {
316 stage('Install StackLight') {
Martin Polreich46971102017-07-11 12:56:40 +0200317 orchestrate.installDockerSwarm(saltMaster)
318 orchestrate.installStacklight(saltMaster)
Ales Komarek24097402017-05-22 16:28:10 +0200319 }
320 }
321
322 //
323 // Test
324 //
325 def artifacts_dir = '_artifacts/'
326
327 if (common.checkContains('STACK_TEST', 'k8s')) {
328 stage('Run k8s bootstrap tests') {
329 def image = 'tomkukral/k8s-scripts'
330 def output_file = image.replaceAll('/', '-') + '.output'
331
332 // run image
Tomáš Kukrál5c2ec132017-07-26 09:57:27 +0200333 test.runConformanceTests(saltMaster, TEST_K8S_API_SERVER, image)
Ales Komarek24097402017-05-22 16:28:10 +0200334
335 // collect output
336 sh "mkdir -p ${artifacts_dir}"
337 file_content = salt.getFileContent(saltMaster, 'ctl01*', '/tmp/' + output_file)
338 writeFile file: "${artifacts_dir}${output_file}", text: file_content
339 sh "cat ${artifacts_dir}${output_file}"
340
341 // collect artifacts
342 archiveArtifacts artifacts: "${artifacts_dir}${output_file}"
343 }
344
345 stage('Run k8s conformance e2e tests') {
Ales Komarek24097402017-05-22 16:28:10 +0200346 def image = K8S_CONFORMANCE_IMAGE
347 def output_file = image.replaceAll('/', '-') + '.output'
348
349 // run image
Tomáš Kukrál5c2ec132017-07-26 09:57:27 +0200350 test.runConformanceTests(saltMaster, TEST_K8S_API_SERVER, image)
Ales Komarek24097402017-05-22 16:28:10 +0200351
352 // collect output
353 sh "mkdir -p ${artifacts_dir}"
354 file_content = salt.getFileContent(saltMaster, 'ctl01*', '/tmp/' + output_file)
355 writeFile file: "${artifacts_dir}${output_file}", text: file_content
356 sh "cat ${artifacts_dir}${output_file}"
357
358 // collect artifacts
359 archiveArtifacts artifacts: "${artifacts_dir}${output_file}"
360 }
361 }
362
363 if (common.checkContains('STACK_TEST', 'openstack')) {
Tomáš Kukrál5c2ec132017-07-26 09:57:27 +0200364 if (common.checkContains('TEST_DOCKER_INSTALL', 'true')) {
365 test.install_docker(saltMaster, TEST_TEMPEST_TARGET)
366 }
367 stage('Run OpenStack tests') {
368 test.runTempestTests(saltMaster, TEST_TEMPEST_IMAGE, TEST_TEMPEST_TARGET, TEST_TEMPEST_PATTERN)
Ales Komarek24097402017-05-22 16:28:10 +0200369 }
370
Tomáš Kukrál5c2ec132017-07-26 09:57:27 +0200371 stage('Copy Tempest results to config node') {
372 test.copyTempestResults(saltMaster, TEST_TEMPEST_TARGET)
Ales Komarek24097402017-05-22 16:28:10 +0200373 }
374 }
375
Tomáš Kukrál53224c22017-07-26 10:53:20 +0200376 if (common.checkContains('STACK_INSTALL', 'finalize')) {
377 stage('Finalize') {
378 salt.runSaltProcessStep(saltMaster, '*', 'state.apply', [], null, true)
Ales Komarek24097402017-05-22 16:28:10 +0200379 }
380 }
Tomáš Kukrál53224c22017-07-26 10:53:20 +0200381
Ales Komarek24097402017-05-22 16:28:10 +0200382 } catch (Throwable e) {
383 currentBuild.result = 'FAILURE'
384 throw e
385 } finally {
386
387
388 //
389 // Clean
390 //
391
Tomáš Kukrál439c62e2017-06-02 11:42:36 +0200392 if (STACK_NAME && STACK_NAME != '') {
Ales Komarek24097402017-05-22 16:28:10 +0200393 // send notification
394 common.sendNotification(currentBuild.result, STACK_NAME, ["slack"])
Tomáš Kukrál439c62e2017-06-02 11:42:36 +0200395 }
Ales Komarek24097402017-05-22 16:28:10 +0200396
Tomáš Kukrál439c62e2017-06-02 11:42:36 +0200397 if (STACK_DELETE.toBoolean() == true) {
398 stage('Trigger cleanup job') {
399 common.errorMsg('Stack cleanup job triggered')
400 build(job: STACK_CLEANUP_JOB, parameters: [
401 [$class: 'StringParameterValue', name: 'STACK_NAME', value: STACK_NAME],
Tomáš Kukrál5c2ec132017-07-26 09:57:27 +0200402 [$class: 'StringParameterValue', name: 'STACK_TYPE', value: STACK_TYPE],
403 [$class: 'StringParameterValue', name: 'OPENSTACK_API_URL', value: OPENSTACK_API_URL],
404 [$class: 'StringParameterValue', name: 'OPENSTACK_API_CREDENTIALS', value: OPENSTACK_API_CREDENTIALS],
405 [$class: 'StringParameterValue', name: 'OPENSTACK_API_PROJECT', value: OPENSTACK_API_PROJECT],
406 [$class: 'StringParameterValue', name: 'OPENSTACK_API_PROJECT_DOMAIN', value: OPENSTACK_API_PROJECT_DOMAIN],
407 [$class: 'StringParameterValue', name: 'OPENSTACK_API_PROJECT_ID', value: OPENSTACK_API_PROJECT_ID],
408 [$class: 'StringParameterValue', name: 'OPENSTACK_API_USER_DOMAIN', value: OPENSTACK_API_USER_DOMAIN],
409 [$class: 'StringParameterValue', name: 'OPENSTACK_API_CLIENT', value: OPENSTACK_API_CLIENT],
410 [$class: 'StringParameterValue', name: 'OPENSTACK_API_VERSION', value: OPENSTACK_API_VERSION]
Tomáš Kukrál439c62e2017-06-02 11:42:36 +0200411 ])
412 }
413 } else {
414 if (currentBuild.result == 'FAILURE') {
415 common.errorMsg("Deploy job FAILED and was not deleted. Please fix the problem and delete stack on you own.")
Tomáš Kukrál5c2ec132017-07-26 09:57:27 +0200416
Tomáš Kukrál439c62e2017-06-02 11:42:36 +0200417 if (SALT_MASTER_URL) {
418 common.errorMsg("Salt master URL: ${SALT_MASTER_URL}")
Ales Komarek24097402017-05-22 16:28:10 +0200419 }
420 }
421 }
422 }
423 }
424}