blob: 3eaaeb667f1c386447a8f77e56a3a796cf34424e [file] [log] [blame]
Ales Komarek24097402017-05-22 16:28:10 +02001/**
2 *
Tomáš Kukrál0d00dd22017-07-27 14:28:36 +02003 * Launch stack and work with it
Ales Komarek24097402017-05-22 16:28:10 +02004 *
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ál0d00dd22017-07-27 14:28:36 +0200192 } else if (STACK_TYPE == 'physical') {
193 common.infoMsg('Using physical stack')
194 } else {
Tomáš Kukrál7a8a4fa2017-05-25 14:54:24 +0200195 throw new Exception("STACK_TYPE ${STACK_TYPE} is not supported")
196 }
Ales Komarek24097402017-05-22 16:28:10 +0200197
Tomáš Kukrál20707642017-06-09 13:35:13 +0200198 // Connect to Salt master
Ales Komarek24097402017-05-22 16:28:10 +0200199 saltMaster = salt.connection(SALT_MASTER_URL, SALT_MASTER_CREDENTIALS)
200 }
201
202 //
203 // Install
204 //
205
206 if (common.checkContains('STACK_INSTALL', 'core')) {
207 stage('Install core infrastructure') {
208 orchestrate.installFoundationInfra(saltMaster)
209
210 if (common.checkContains('STACK_INSTALL', 'kvm')) {
211 orchestrate.installInfraKvm(saltMaster)
212 orchestrate.installFoundationInfra(saltMaster)
213 }
214
215 orchestrate.validateFoundationInfra(saltMaster)
216 }
217 }
218
Matthew Mosesohn30afef92017-07-19 16:49:45 +0300219 // Set up override params
220 if (env.getEnvironment().containsKey('SALT_OVERRIDES')) {
221 stage('Set Salt overrides') {
222 salt.setSaltOverrides(saltMaster, SALT_OVERRIDES)
223 }
224 }
225
226
Ales Komarek24097402017-05-22 16:28:10 +0200227 // install k8s
228 if (common.checkContains('STACK_INSTALL', 'k8s')) {
vrovachev7be1e962017-07-05 13:28:26 +0400229
Ales Komarek24097402017-05-22 16:28:10 +0200230 stage('Install Kubernetes infra') {
Tomáš Kukrál39c96cd2017-07-11 10:14:13 +0200231 if (STACK_TYPE == 'aws') {
232 // configure kubernetes_control_address - save loadbalancer
233 def kubernetes_control_address = aws.getOutputs(venv, aws_env_vars, STACK_NAME, 'ControlLoadBalancer')
234 print(kubernetes_control_address)
235 salt.runSaltProcessStep(saltMaster, 'I@salt:master', 'reclass.cluster_meta_set', ['kubernetes_control_address', kubernetes_control_address], null, true)
236 }
Tomáš Kukrál4898be32017-06-19 09:54:15 +0200237 // ensure certificates are generated properly
238 salt.runSaltProcessStep(saltMaster, '*', 'saltutil.refresh_pillar', [], null, true)
239 salt.enforceState(saltMaster, '*', ['salt.minion.cert'], true)
240
Ales Komarek24097402017-05-22 16:28:10 +0200241 orchestrate.installKubernetesInfra(saltMaster)
242 }
243
vrovachev7be1e962017-07-05 13:28:26 +0400244 if (common.checkContains('STACK_INSTALL', 'contrail')) {
245 stage('Install Contrail for Kubernetes') {
246 orchestrate.installContrailNetwork(saltMaster)
vrovachev7be1e962017-07-05 13:28:26 +0400247 orchestrate.installKubernetesContrailCompute(saltMaster)
248 }
249 }
250
Ales Komarek24097402017-05-22 16:28:10 +0200251 stage('Install Kubernetes control') {
252
Ales Komarek24097402017-05-22 16:28:10 +0200253 orchestrate.installKubernetesControl(saltMaster)
254 }
255
Tomáš Kukrál74f92862017-06-05 19:18:43 +0200256 stage('Scale Kubernetes computes') {
Tomáš Kukrálb9a7d6f2017-06-07 14:05:31 +0200257 if (STACK_COMPUTE_COUNT > 0) {
258 if (STACK_TYPE == 'aws') {
Tomáš Kukrálb9a7d6f2017-06-07 14:05:31 +0200259 // get stack info
Tomáš Kukrála1d86b82017-07-10 17:24:01 +0200260 def scaling_group = aws.getOutputs(venv, aws_env_vars, STACK_NAME, 'ComputesScalingGroup')
Tomáš Kukrál74f92862017-06-05 19:18:43 +0200261
Tomáš Kukrálb9a7d6f2017-06-07 14:05:31 +0200262 //update autoscaling group
Tomáš Kukrála1d86b82017-07-10 17:24:01 +0200263 aws.updateAutoscalingGroup(venv, aws_env_vars, scaling_group, ["--desired-capacity " + STACK_COMPUTE_COUNT])
Tomáš Kukrál8130a562017-06-06 11:09:22 +0200264
Tomáš Kukrálb9a7d6f2017-06-07 14:05:31 +0200265 // wait for computes to boot up
Tomáš Kukrála1d86b82017-07-10 17:24:01 +0200266 aws.waitForAutoscalingInstances(venv, aws_env_vars, scaling_group)
Tomáš Kukrálf31a5912017-06-13 15:47:25 +0200267 sleep(60)
Tomáš Kukrálb9a7d6f2017-06-07 14:05:31 +0200268 }
269
270 orchestrate.installKubernetesCompute(saltMaster)
Tomáš Kukrál74f92862017-06-05 19:18:43 +0200271 }
Tomáš Kukrál74f92862017-06-05 19:18:43 +0200272 }
Ales Komarek24097402017-05-22 16:28:10 +0200273 }
274
275 // install openstack
276 if (common.checkContains('STACK_INSTALL', 'openstack')) {
277 // install Infra and control, tests, ...
278
279 stage('Install OpenStack infra') {
280 orchestrate.installOpenstackInfra(saltMaster)
281 }
282
283 stage('Install OpenStack control') {
284 orchestrate.installOpenstackControl(saltMaster)
285 }
286
287 stage('Install OpenStack network') {
288
289 if (common.checkContains('STACK_INSTALL', 'contrail')) {
290 orchestrate.installContrailNetwork(saltMaster)
291 } else if (common.checkContains('STACK_INSTALL', 'ovs')) {
292 orchestrate.installOpenstackNetwork(saltMaster)
293 }
294
295 salt.runSaltProcessStep(saltMaster, 'I@keystone:server', 'cmd.run', ['. /root/keystonerc; neutron net-list'])
296 salt.runSaltProcessStep(saltMaster, 'I@keystone:server', 'cmd.run', ['. /root/keystonerc; nova net-list'])
297 }
298
299 stage('Install OpenStack compute') {
300 orchestrate.installOpenstackCompute(saltMaster)
301
302 if (common.checkContains('STACK_INSTALL', 'contrail')) {
303 orchestrate.installContrailCompute(saltMaster)
304 }
305 }
306
307 }
308
309
Martin Polreich46971102017-07-11 12:56:40 +0200310 if (common.checkContains('STACK_INSTALL', 'sl-legacy')) {
311 stage('Install StackLight v1') {
312 orchestrate.installStacklightv1Control(saltMaster)
313 orchestrate.installStacklightv1Client(saltMaster)
314 }
315 }
316
Ales Komarek24097402017-05-22 16:28:10 +0200317 if (common.checkContains('STACK_INSTALL', 'stacklight')) {
318 stage('Install StackLight') {
Martin Polreich46971102017-07-11 12:56:40 +0200319 orchestrate.installDockerSwarm(saltMaster)
320 orchestrate.installStacklight(saltMaster)
Ales Komarek24097402017-05-22 16:28:10 +0200321 }
322 }
323
324 //
325 // Test
326 //
327 def artifacts_dir = '_artifacts/'
328
329 if (common.checkContains('STACK_TEST', 'k8s')) {
330 stage('Run k8s bootstrap tests') {
331 def image = 'tomkukral/k8s-scripts'
332 def output_file = image.replaceAll('/', '-') + '.output'
333
334 // run image
Tomáš Kukrál5c2ec132017-07-26 09:57:27 +0200335 test.runConformanceTests(saltMaster, TEST_K8S_API_SERVER, image)
Ales Komarek24097402017-05-22 16:28:10 +0200336
337 // collect output
338 sh "mkdir -p ${artifacts_dir}"
339 file_content = salt.getFileContent(saltMaster, 'ctl01*', '/tmp/' + output_file)
340 writeFile file: "${artifacts_dir}${output_file}", text: file_content
341 sh "cat ${artifacts_dir}${output_file}"
342
343 // collect artifacts
344 archiveArtifacts artifacts: "${artifacts_dir}${output_file}"
345 }
346
347 stage('Run k8s conformance e2e tests') {
Ales Komarek24097402017-05-22 16:28:10 +0200348 def image = K8S_CONFORMANCE_IMAGE
349 def output_file = image.replaceAll('/', '-') + '.output'
350
351 // run image
Tomáš Kukrál5c2ec132017-07-26 09:57:27 +0200352 test.runConformanceTests(saltMaster, TEST_K8S_API_SERVER, image)
Ales Komarek24097402017-05-22 16:28:10 +0200353
354 // collect output
355 sh "mkdir -p ${artifacts_dir}"
356 file_content = salt.getFileContent(saltMaster, 'ctl01*', '/tmp/' + output_file)
357 writeFile file: "${artifacts_dir}${output_file}", text: file_content
358 sh "cat ${artifacts_dir}${output_file}"
359
360 // collect artifacts
361 archiveArtifacts artifacts: "${artifacts_dir}${output_file}"
362 }
363 }
364
365 if (common.checkContains('STACK_TEST', 'openstack')) {
Tomáš Kukrál5c2ec132017-07-26 09:57:27 +0200366 if (common.checkContains('TEST_DOCKER_INSTALL', 'true')) {
367 test.install_docker(saltMaster, TEST_TEMPEST_TARGET)
368 }
369 stage('Run OpenStack tests') {
370 test.runTempestTests(saltMaster, TEST_TEMPEST_IMAGE, TEST_TEMPEST_TARGET, TEST_TEMPEST_PATTERN)
Ales Komarek24097402017-05-22 16:28:10 +0200371 }
372
Tomáš Kukrál5c2ec132017-07-26 09:57:27 +0200373 stage('Copy Tempest results to config node') {
374 test.copyTempestResults(saltMaster, TEST_TEMPEST_TARGET)
Ales Komarek24097402017-05-22 16:28:10 +0200375 }
376 }
377
Tomáš Kukrál53224c22017-07-26 10:53:20 +0200378 if (common.checkContains('STACK_INSTALL', 'finalize')) {
379 stage('Finalize') {
380 salt.runSaltProcessStep(saltMaster, '*', 'state.apply', [], null, true)
Ales Komarek24097402017-05-22 16:28:10 +0200381 }
382 }
Tomáš Kukrál53224c22017-07-26 10:53:20 +0200383
Ales Komarek24097402017-05-22 16:28:10 +0200384 } catch (Throwable e) {
385 currentBuild.result = 'FAILURE'
386 throw e
387 } finally {
388
389
390 //
391 // Clean
392 //
393
Tomáš Kukrál439c62e2017-06-02 11:42:36 +0200394 if (STACK_NAME && STACK_NAME != '') {
Ales Komarek24097402017-05-22 16:28:10 +0200395 // send notification
396 common.sendNotification(currentBuild.result, STACK_NAME, ["slack"])
Tomáš Kukrál439c62e2017-06-02 11:42:36 +0200397 }
Ales Komarek24097402017-05-22 16:28:10 +0200398
Tomáš Kukrál439c62e2017-06-02 11:42:36 +0200399 if (STACK_DELETE.toBoolean() == true) {
400 stage('Trigger cleanup job') {
401 common.errorMsg('Stack cleanup job triggered')
402 build(job: STACK_CLEANUP_JOB, parameters: [
403 [$class: 'StringParameterValue', name: 'STACK_NAME', value: STACK_NAME],
Tomáš Kukrál5c2ec132017-07-26 09:57:27 +0200404 [$class: 'StringParameterValue', name: 'STACK_TYPE', value: STACK_TYPE],
405 [$class: 'StringParameterValue', name: 'OPENSTACK_API_URL', value: OPENSTACK_API_URL],
406 [$class: 'StringParameterValue', name: 'OPENSTACK_API_CREDENTIALS', value: OPENSTACK_API_CREDENTIALS],
407 [$class: 'StringParameterValue', name: 'OPENSTACK_API_PROJECT', value: OPENSTACK_API_PROJECT],
408 [$class: 'StringParameterValue', name: 'OPENSTACK_API_PROJECT_DOMAIN', value: OPENSTACK_API_PROJECT_DOMAIN],
409 [$class: 'StringParameterValue', name: 'OPENSTACK_API_PROJECT_ID', value: OPENSTACK_API_PROJECT_ID],
410 [$class: 'StringParameterValue', name: 'OPENSTACK_API_USER_DOMAIN', value: OPENSTACK_API_USER_DOMAIN],
411 [$class: 'StringParameterValue', name: 'OPENSTACK_API_CLIENT', value: OPENSTACK_API_CLIENT],
412 [$class: 'StringParameterValue', name: 'OPENSTACK_API_VERSION', value: OPENSTACK_API_VERSION]
Tomáš Kukrál439c62e2017-06-02 11:42:36 +0200413 ])
414 }
415 } else {
416 if (currentBuild.result == 'FAILURE') {
417 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 +0200418
Tomáš Kukrál439c62e2017-06-02 11:42:36 +0200419 if (SALT_MASTER_URL) {
420 common.errorMsg("Salt master URL: ${SALT_MASTER_URL}")
Ales Komarek24097402017-05-22 16:28:10 +0200421 }
422 }
423 }
424 }
425 }
426}