blob: b56ff9f2682a6eabe38d7723111d721956810851 [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
Tomáš Kukrál4691f682017-07-27 16:36:12 +02007 * STACK_TEMPLATE File with stack template
8 * STACK_TYPE Deploy OpenStack/AWS [heat/aws], use 'physical' if no stack should be started
Ales Komarek24097402017-05-22 16:28:10 +02009 *
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)
Tomáš Kukrál4691f682017-07-27 16:36:12 +020015 * STACK_REUSE Reuse existing stack (don't create one, only read outputs)
Ales Komarek24097402017-05-22 16:28:10 +020016 * 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
Vasyl Saienkoa81e9312018-03-06 01:28:35 +020021 * STACK_CLUSTER_NAME The name of cluster model to use
Jiri Broulik61b3e5d2017-12-19 15:42:30 +010022 * STATIC_MGMT_NETWORK Check if model contains static IP address definitions for all nodes
Tomáš Kukrál74f92862017-06-05 19:18:43 +020023 *
Ales Komarek24097402017-05-22 16:28:10 +020024 * AWS_STACK_REGION CloudFormation AWS region
25 * AWS_API_CREDENTIALS AWS Access key ID with AWS secret access key
Tomáš Kukrál7a8a4fa2017-05-25 14:54:24 +020026 * AWS_SSH_KEY AWS key pair name (used for SSH access)
Ales Komarek24097402017-05-22 16:28:10 +020027 *
28 * HEAT_STACK_ENVIRONMENT Heat stack environmental parameters
29 * HEAT_STACK_ZONE Heat stack availability zone
30 * HEAT_STACK_PUBLIC_NET Heat stack floating IP pool
31 * OPENSTACK_API_URL OpenStack API address
32 * OPENSTACK_API_CREDENTIALS Credentials to the OpenStack API
33 * OPENSTACK_API_PROJECT OpenStack project to connect to
34 * OPENSTACK_API_CLIENT Versions of OpenStack python clients
35 * OPENSTACK_API_VERSION Version of the OpenStack API (2/3)
Oleh Hryhorov9630a762017-10-24 14:33:25 +030036 * SLAVE_NODE Lable or node name where the job will be run
Tomáš Kukrál5c2ec132017-07-26 09:57:27 +020037
Ales Komarek24097402017-05-22 16:28:10 +020038 * SALT_MASTER_CREDENTIALS Credentials to the Salt API
Tomáš Kukrál4691f682017-07-27 16:36:12 +020039 * required for STACK_TYPE=physical
Ales Komarek24097402017-05-22 16:28:10 +020040 * SALT_MASTER_URL URL of Salt master
Tomáš Kukrál5c2ec132017-07-26 09:57:27 +020041
Oleg Iurchenko9a8c3d72017-12-21 14:55:38 +020042 * BOOTSTRAP_EXTRA_REPO_PARAMS optional parameter to define a list of extra repos with parameters
43 * which have to be added during bootstrap.
44 * Format: repo 1, repo priority 1, repo pin 1; repo 2, repo priority 2, repo pin 2;
45
Oleh Hryhorov825b5be2018-06-13 13:01:53 +030046 * SALT_VERSION Version of Salt which is going to be installed i.e. 'stable 2016.3' or 'stable 2017.7' etc.
47 *
Oleh Hryhorov2a63aa62018-06-22 17:26:41 +030048 * EXTRA_TARGET The value will be added to target nodes
Denis Egorenkoca6aeca2019-08-19 19:41:27 +040049 * BATCH_SIZE Use batching for states, which may be targeted for huge amount of nodes. Format:
50 - 10 - number of nodes
51 - 10% - percentage of all targeted nodes
52
Oleh Hryhorov2a63aa62018-06-22 17:26:41 +030053 *
Tomáš Kukrál5c2ec132017-07-26 09:57:27 +020054 * Test settings:
55 * TEST_K8S_API_SERVER Kubernetes API address
56 * TEST_K8S_CONFORMANCE_IMAGE Path to docker image with conformance e2e tests
Ales Komarek24097402017-05-22 16:28:10 +020057 *
Tomáš Kukrál5c2ec132017-07-26 09:57:27 +020058 * TEST_DOCKER_INSTALL Install docker on the target if true
59 * TEST_TEMPEST_IMAGE Tempest image link
60 * TEST_TEMPEST_PATTERN If not false, run tests matched to pattern only
61 * TEST_TEMPEST_TARGET Salt target for tempest node
ibumarskov637a2152018-01-16 10:39:57 +040062 * TESTRAIL_REPORT Whether upload results to testrail or not
63 * TESTRAIL_REPORTER_IMAGE Docker image for testrail reporter
64 * TESTRAIL_QA_CREDENTIALS Credentials for upload to testrail
65 * TESTRAIL_MILESTONE Product version for tests
66 * TESTRAIL_PLAN Testrail test plan
67 * TESTRAIL_GROUP Testrail test group
68 * TESTRAIL_SUITE Testrail test suite
Ales Komarek24097402017-05-22 16:28:10 +020069 *
Tomáš Kukrál5c2ec132017-07-26 09:57:27 +020070 * optional parameters for overwriting soft params
71 * SALT_OVERRIDES YAML with overrides for Salt deployment
Ales Komarek24097402017-05-22 16:28:10 +020072 *
73 */
Tomáš Kukrál3a17dd62017-07-27 18:24:16 +020074
Ales Komarek24097402017-05-22 16:28:10 +020075common = new com.mirantis.mk.Common()
76git = new com.mirantis.mk.Git()
77openstack = new com.mirantis.mk.Openstack()
Tomáš Kukrál7a8a4fa2017-05-25 14:54:24 +020078aws = new com.mirantis.mk.Aws()
Ales Komarek24097402017-05-22 16:28:10 +020079orchestrate = new com.mirantis.mk.Orchestrate()
Mykyta Karpine016d7e2017-10-09 13:35:20 +030080python = new com.mirantis.mk.Python()
Ales Komarek24097402017-05-22 16:28:10 +020081salt = new com.mirantis.mk.Salt()
82test = new com.mirantis.mk.Test()
83
84_MAX_PERMITTED_STACKS = 2
85overwriteFile = "/srv/salt/reclass/classes/cluster/override.yml"
86
Tomáš Kukrála1d86b82017-07-10 17:24:01 +020087// Define global variables
Tomáš Kukrála1d86b82017-07-10 17:24:01 +020088def venv
chnyda597fb032017-10-06 13:42:48 +020089def venvPepper
Tomáš Kukrál8e50d8e2017-09-01 17:40:53 +020090def outputs = [:]
Tomáš Kukrálbc4be252017-06-06 11:28:40 +020091
chnydae14058a2017-08-29 15:07:48 +020092def ipRegex = "\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}"
93
Tomáš Kukrálb19bdda2017-06-13 17:09:43 +020094if (STACK_TYPE == 'aws') {
Tomáš Kukrála1d86b82017-07-10 17:24:01 +020095 def aws_env_vars
Tomáš Kukrál8427ff52017-08-30 15:46:52 +020096} else if (STACK_TYPE == 'heat') {
97 def envParams
98 def openstackCloud
Tomáš Kukrálb19bdda2017-06-13 17:09:43 +020099}
100
Oleh Hryhorov9630a762017-10-24 14:33:25 +0300101def slave_node = 'python'
102
Oleh Hryhorov54460512017-10-26 18:45:36 +0300103if (common.validInputParam('SLAVE_NODE')) {
Oleh Hryhorov9630a762017-10-24 14:33:25 +0300104 slave_node = SLAVE_NODE
105}
Oleh Hryhorov2a63aa62018-06-22 17:26:41 +0300106
107def extra_tgt = ''
108if (common.validInputParam('EXTRA_TARGET')) {
109 extra_tgt = "${EXTRA_TARGET}"
110}
Denis Egorenkoca6aeca2019-08-19 19:41:27 +0400111def batch_size = ''
112if (common.validInputParam('BATCH_SIZE')) {
113 batch_size = "${BATCH_SIZE}"
114}
Oleh Hryhorov2a63aa62018-06-22 17:26:41 +0300115
Jakub Josefa63f9862018-01-11 17:58:38 +0100116timeout(time: 12, unit: 'HOURS') {
117 node(slave_node) {
118 try {
119 // Set build-specific variables
Jakub Josef88aaf832018-01-18 16:18:28 +0100120 def workspace = common.getWorkspace()
121 venv = "${workspace}/venv"
122 venvPepper = "${workspace}/venvPepper"
Jakub Josef052e77a2018-03-05 15:19:03 +0100123 if(common.validInputParam("STACK_DELETE") && STACK_DELETE.toBoolean()){
124 common.warningMsg("You running stack with STACK_DELETE option enabled, deployed stack will be removed at the end!")
125 }
Jakub Josefa63f9862018-01-11 17:58:38 +0100126 //
127 // Prepare machines
128 //
129 stage ('Create infrastructure') {
Tomáš Kukrála1d86b82017-07-10 17:24:01 +0200130
Jakub Josefa63f9862018-01-11 17:58:38 +0100131 outputs.put('stack_type', STACK_TYPE)
Ales Komarek24097402017-05-22 16:28:10 +0200132
Jakub Josefa63f9862018-01-11 17:58:38 +0100133 if (STACK_TYPE == 'heat') {
134 // value defaults
135 envParams = [
136 'cluster_zone': HEAT_STACK_ZONE,
137 'cluster_public_net': HEAT_STACK_PUBLIC_NET
138 ]
Tomáš Kukrál8e50d8e2017-09-01 17:40:53 +0200139
Jakub Josefa63f9862018-01-11 17:58:38 +0100140 if (STACK_REUSE.toBoolean() == true && STACK_NAME == '') {
141 error("If you want to reuse existing stack you need to provide it's name")
Ruslan Kamaldinov65144322017-08-02 15:16:55 +0400142 }
Tomáš Kukrál550364e2017-08-23 11:42:45 +0200143
Jakub Josefa63f9862018-01-11 17:58:38 +0100144 if (STACK_REUSE.toBoolean() == false) {
145 // Don't allow to set custom heat stack name
146 wrap([$class: 'BuildUser']) {
147 if (env.BUILD_USER_ID) {
148 STACK_NAME = "${env.BUILD_USER_ID}-${JOB_NAME}-${BUILD_NUMBER}"
149 } else {
150 STACK_NAME = "jenkins-${JOB_NAME}-${BUILD_NUMBER}"
151 }
152 currentBuild.description = STACK_NAME
Ales Komarek24097402017-05-22 16:28:10 +0200153 }
Inessa Vasilevskaya7fd23f22018-10-09 10:58:46 +0200154 } else {
155 // In case name was copied with unicode zero-width space chars -
156 // remove them
157 STACK_NAME = STACK_NAME.trim().replaceAll("\\p{C}", "")
Ales Komarek24097402017-05-22 16:28:10 +0200158 }
159
Ruslan Kamaldinov65144322017-08-02 15:16:55 +0400160 // no underscore in STACK_NAME
161 STACK_NAME = STACK_NAME.replaceAll('_', '-')
Jakub Josefa63f9862018-01-11 17:58:38 +0100162 outputs.put('stack_name', STACK_NAME)
Ales Komarek24097402017-05-22 16:28:10 +0200163
Jakub Josefa63f9862018-01-11 17:58:38 +0100164 // set description
165 currentBuild.description = "${STACK_NAME}"
Ruslan Kamaldinov65144322017-08-02 15:16:55 +0400166
Ales Komarek24097402017-05-22 16:28:10 +0200167 // get templates
168 git.checkoutGitRepository('template', STACK_TEMPLATE_URL, STACK_TEMPLATE_BRANCH, STACK_TEMPLATE_CREDENTIALS)
169
Jakub Josefa63f9862018-01-11 17:58:38 +0100170 // create openstack env
171 openstack.setupOpenstackVirtualenv(venv, OPENSTACK_API_CLIENT)
Jakub Josef88aaf832018-01-18 16:18:28 +0100172 openstackCloud = openstack.createOpenstackEnv(venv,
Jakub Josefa63f9862018-01-11 17:58:38 +0100173 OPENSTACK_API_URL, OPENSTACK_API_CREDENTIALS,
174 OPENSTACK_API_PROJECT, OPENSTACK_API_PROJECT_DOMAIN,
175 OPENSTACK_API_PROJECT_ID, OPENSTACK_API_USER_DOMAIN,
176 OPENSTACK_API_VERSION)
177 openstack.getKeystoneToken(openstackCloud, venv)
Ales Komarek24097402017-05-22 16:28:10 +0200178
Jakub Josefa63f9862018-01-11 17:58:38 +0100179 //
180 // Verify possibility of create stack for given user and stack type
181 //
182 wrap([$class: 'BuildUser']) {
183 if (env.BUILD_USER_ID && !env.BUILD_USER_ID.equals("jenkins") && !STACK_REUSE.toBoolean()) {
184 def existingStacks = openstack.getStacksForNameContains(openstackCloud, "${env.BUILD_USER_ID}-${JOB_NAME}".replaceAll('_', '-'), venv)
185 if (existingStacks.size() >= _MAX_PERMITTED_STACKS) {
186 STACK_DELETE = "false"
187 throw new Exception("You cannot create new stack, you already have ${_MAX_PERMITTED_STACKS} stacks of this type (${JOB_NAME}). \nStack names: ${existingStacks}")
188 }
189 }
Tomáš Kukrál8e50d8e2017-09-01 17:40:53 +0200190 }
Jakub Josefa63f9862018-01-11 17:58:38 +0100191 // launch stack
192 if (STACK_REUSE.toBoolean() == false) {
Ruslan Kamaldinov65144322017-08-02 15:16:55 +0400193
Jakub Josefa63f9862018-01-11 17:58:38 +0100194 // set reclass repo in heat env
195 try {
196 envParams.put('cfg_reclass_branch', STACK_RECLASS_BRANCH)
197 envParams.put('cfg_reclass_address', STACK_RECLASS_ADDRESS)
198 } catch (MissingPropertyException e) {
199 common.infoMsg("Property STACK_RECLASS_BRANCH or STACK_RECLASS_ADDRESS not found! Using default values from template.")
Tomáš Kukrálf83409d2017-11-08 20:56:57 +0100200 }
201
Jakub Josefa63f9862018-01-11 17:58:38 +0100202 // put formulas revision - stable, testing or nightly
203 if (common.validInputParam('FORMULA_PKG_REVISION')) {
204 common.infoMsg("Setting formulas revision to ${FORMULA_PKG_REVISION}")
205 envParams.put('cfg_formula_pkg_revision', FORMULA_PKG_REVISION)
206 }
207
208 // put extra repo definitions
209 if (common.validInputParam('BOOTSTRAP_EXTRA_REPO_PARAMS')) {
210 common.infoMsg("Setting additional repo during bootstrap to ${BOOTSTRAP_EXTRA_REPO_PARAMS}")
211 envParams.put('cfg_bootstrap_extra_repo_params', BOOTSTRAP_EXTRA_REPO_PARAMS)
212 }
213
azvyagintsevb8ddb492018-09-12 14:59:45 +0300214 // put extra salt-formulas # FIXME: looks like some outdated logic. See #PROD-23127
Jakub Josefa63f9862018-01-11 17:58:38 +0100215 if (common.validInputParam('EXTRA_FORMULAS')) {
216 common.infoMsg("Setting extra salt-formulas to ${EXTRA_FORMULAS}")
217 envParams.put('cfg_extra_formulas', EXTRA_FORMULAS)
218 }
219
Vasyl Saienkoa81e9312018-03-06 01:28:35 +0200220 // add cluster name if specified
221 if (common.validInputParam('STACK_CLUSTER_NAME')) {
222 common.infoMsg("Setting cluster_name to ${STACK_CLUSTER_NAME}")
223 envParams.put('cluster_name', STACK_CLUSTER_NAME)
224 }
225
Vasyl Saienko51139fd2018-04-20 12:01:50 +0300226 if (common.validInputParam('STACK_COMPUTE_COUNT')) {
227 if (STACK_COMPUTE_COUNT.toInteger() > 0){
228 common.infoMsg("Setting cluster_node_count to ${STACK_COMPUTE_COUNT}")
229 envParams.put('cluster_node_count', STACK_COMPUTE_COUNT)
230 }
231 }
232
Oleh Hryhorov825b5be2018-06-13 13:01:53 +0300233
234 if (common.validInputParam('SALT_VERSION')) {
235 common.infoMsg("Setting salt version to ${SALT_VERSION}")
236 envParams.put('cfg_saltversion', SALT_VERSION)
237 }
238
Mykyta Karpin35f71332018-07-27 11:54:51 +0300239 // If stack wasn't removed by the same user which has created it,
240 // nova key pair won't be removed, so need to make sure that no
241 // key pair with the same name exists before creating the stack.
242 if (openstack.getKeyPair(openstackCloud, STACK_NAME, venv)){
243 try {
244 openstack.deleteKeyPair(openstackCloud, STACK_NAME, venv)
245 } catch (Exception e) {
246 common.errorMsg("Key pair failed to remove with error ${e.message}")
247 }
248 }
249
Jakub Josefa63f9862018-01-11 17:58:38 +0100250 openstack.createHeatStack(openstackCloud, STACK_NAME, STACK_TEMPLATE, envParams, HEAT_STACK_ENVIRONMENT, venv)
251 }
252
253 // get SALT_MASTER_URL
254 saltMasterHost = openstack.getHeatStackOutputParam(openstackCloud, STACK_NAME, 'salt_master_ip', venv)
255 // check that saltMasterHost is valid
256 if (!saltMasterHost || !saltMasterHost.matches(ipRegex)) {
257 common.errorMsg("saltMasterHost is not a valid ip, value is: ${saltMasterHost}")
258 throw new Exception("saltMasterHost is not a valid ip")
259 }
260
261 currentBuild.description = "${STACK_NAME} ${saltMasterHost}"
262
263 SALT_MASTER_URL = "http://${saltMasterHost}:6969"
264
265 } else if (STACK_TYPE == 'aws') {
266
267 // setup environment
268 aws.setupVirtualEnv(venv)
269
270 // set aws_env_vars
271 aws_env_vars = aws.getEnvVars(AWS_API_CREDENTIALS, AWS_STACK_REGION)
272
273 if (STACK_REUSE.toBoolean() == true && STACK_NAME == '') {
274 error("If you want to reuse existing stack you need to provide it's name")
275 }
276
277 if (STACK_REUSE.toBoolean() == false) {
278 // Don't allow to set custom stack name
279 wrap([$class: 'BuildUser']) {
280 if (env.BUILD_USER_ID) {
281 STACK_NAME = "${env.BUILD_USER_ID}-${JOB_NAME}-${BUILD_NUMBER}"
282 } else {
283 STACK_NAME = "jenkins-${JOB_NAME}-${BUILD_NUMBER}"
284 }
285 }
286
287 // no underscore in STACK_NAME
288 STACK_NAME = STACK_NAME.replaceAll('_', '-')
289 }
290
291 // set description
292 currentBuild.description = STACK_NAME
293 outputs.put('stack_name', STACK_NAME)
294
295 if (STACK_REUSE.toBoolean() == false) {
296 // get templates
297 git.checkoutGitRepository('template', STACK_TEMPLATE_URL, STACK_TEMPLATE_BRANCH, STACK_TEMPLATE_CREDENTIALS)
298
299 // start stack
300 def stack_params = [
301 "ParameterKey=KeyName,ParameterValue=" + AWS_SSH_KEY,
302 "ParameterKey=CmpNodeCount,ParameterValue=" + STACK_COMPUTE_COUNT
303 ]
304 def template_file = 'cfn/' + STACK_TEMPLATE + '.yml'
305 aws.createStack(venv, aws_env_vars, template_file, STACK_NAME, stack_params)
306 }
307
308 // wait for stack to be ready
309 aws.waitForStatus(venv, aws_env_vars, STACK_NAME, 'CREATE_COMPLETE')
310
311 // get outputs
312 saltMasterHost = aws.getOutputs(venv, aws_env_vars, STACK_NAME, 'SaltMasterIP')
313
314 // check that saltMasterHost is valid
315 if (!saltMasterHost || !saltMasterHost.matches(ipRegex)) {
316 common.errorMsg("saltMasterHost is not a valid ip, value is: ${saltMasterHost}")
317 throw new Exception("saltMasterHost is not a valid ip")
318 }
319
320 currentBuild.description = "${STACK_NAME} ${saltMasterHost}"
321 SALT_MASTER_URL = "http://${saltMasterHost}:6969"
322
323 } else if (STACK_TYPE != 'physical') {
324 throw new Exception("STACK_TYPE ${STACK_TYPE} is not supported")
325 }
326
327 outputs.put('salt_api', SALT_MASTER_URL)
328
329 // Setup virtualenv for pepper
330 python.setupPepperVirtualenv(venvPepper, SALT_MASTER_URL, SALT_MASTER_CREDENTIALS)
331 }
332
333
334 // Set up override params
335 if (common.validInputParam('SALT_OVERRIDES')) {
336 stage('Set Salt overrides') {
Oleh Hryhorov2a63aa62018-06-22 17:26:41 +0300337 salt.setSaltOverrides(venvPepper, SALT_OVERRIDES, '/srv/salt/reclass', extra_tgt)
Jakub Josefa63f9862018-01-11 17:58:38 +0100338 }
339 }
340
341 //
342 // Install
343 //
Denis Egorenkoca6aeca2019-08-19 19:41:27 +0400344 if (!batch_size) {
345 def workerThreads = salt.getReturnValues(salt.getPillar(venvPepper, "I@salt:master", "salt:master:worker_threads", null))
346 if (workerThreads.isInteger() && workerThreads.toInteger() > 0) {
347 batch_size = workerThreads
348 }
349 }
Jakub Josefa63f9862018-01-11 17:58:38 +0100350
Martin Polreichacc8b192019-03-28 12:50:57 +0100351 // Check if all minions are reachable and ready
Denis Egorenkoca6aeca2019-08-19 19:41:27 +0400352 salt.checkTargetMinionsReady(['saltId': venvPepper, 'target': '*', batch: batch_size])
Martin Polreichacc8b192019-03-28 12:50:57 +0100353
Jakub Josefa63f9862018-01-11 17:58:38 +0100354 if (common.checkContains('STACK_INSTALL', 'core')) {
355 stage('Install core infrastructure') {
356 def staticMgmtNetwork = false
357 if (common.validInputParam('STATIC_MGMT_NETWORK')) {
358 staticMgmtNetwork = STATIC_MGMT_NETWORK.toBoolean()
359 }
Denis Egorenkoca6aeca2019-08-19 19:41:27 +0400360 orchestrate.installFoundationInfra(venvPepper, staticMgmtNetwork, extra_tgt, batch_size)
Jakub Josefa63f9862018-01-11 17:58:38 +0100361
362 if (common.checkContains('STACK_INSTALL', 'kvm')) {
Oleh Hryhorov2a63aa62018-06-22 17:26:41 +0300363 orchestrate.installInfraKvm(venvPepper, extra_tgt)
Dzmitry Stremkouski16fb74f2018-07-10 02:01:34 +0200364 orchestrate.installFoundationInfra(venvPepper, staticMgmtNetwork, extra_tgt)
Jakub Josefa63f9862018-01-11 17:58:38 +0100365 }
366
Oleh Hryhorov2a63aa62018-06-22 17:26:41 +0300367 orchestrate.validateFoundationInfra(venvPepper, extra_tgt)
Jakub Josefa63f9862018-01-11 17:58:38 +0100368 }
369 }
370
Oleksii Grudevd3d5fad2018-06-29 16:25:35 +0300371 stage('Install infra') {
372 if (common.checkContains('STACK_INSTALL', 'core') ||
373 common.checkContains('STACK_INSTALL', 'openstack') ||
374 common.checkContains('STACK_INSTALL', 'oss')) {
375 orchestrate.installInfra(venvPepper, extra_tgt)
376 }
377 }
378
Vasyl Saienko4c78fe12018-08-06 10:17:28 +0300379 stage('Install Orchestrated Apps'){
380 orchestrate.OrchestrateApplications(venvPepper, "I@salt:master ${extra_tgt}", "orchestration.deploy.applications")
381 }
382
Jakub Josefa63f9862018-01-11 17:58:38 +0100383 // install k8s
384 if (common.checkContains('STACK_INSTALL', 'k8s')) {
385
386 stage('Install Kubernetes infra') {
387 if (STACK_TYPE == 'aws') {
388 // configure kubernetes_control_address - save loadbalancer
389 def awsOutputs = aws.getOutputs(venv, aws_env_vars, STACK_NAME)
390 common.prettyPrint(awsOutputs)
391 if (awsOutputs.containsKey('ControlLoadBalancer')) {
Oleh Hryhorov2a63aa62018-06-22 17:26:41 +0300392 salt.runSaltProcessStep(venvPepper, "I@salt:master ${extra_tgt}", 'reclass.cluster_meta_set', ['kubernetes_control_address', awsOutputs['ControlLoadBalancer']], null, true)
Jakub Josefa63f9862018-01-11 17:58:38 +0100393 outputs.put('kubernetes_apiserver', 'https://' + awsOutputs['ControlLoadBalancer'])
394 }
395 }
396
397 // ensure certificates are generated properly
Andrey Shestakovf23ed002018-08-21 12:09:51 +0300398 salt.runSaltProcessStep(venvPepper, "I@kubernetes:* ${extra_tgt}", 'saltutil.refresh_pillar', [], null, true)
399 salt.enforceState(venvPepper, "I@kubernetes:* ${extra_tgt}", ['salt.minion.cert'], true)
Jakub Josefa63f9862018-01-11 17:58:38 +0100400 }
401
402 if (common.checkContains('STACK_INSTALL', 'contrail')) {
Svimbaa554ea02018-06-06 18:45:23 +0200403 stage('Install Contrail control') {
Oleh Hryhorov2a63aa62018-06-22 17:26:41 +0300404 orchestrate.installContrailNetwork(venvPepper, extra_tgt)
Tomáš Kukrál39c96cd2017-07-11 10:14:13 +0200405 }
Ales Komarek24097402017-05-22 16:28:10 +0200406 }
Tomáš Kukrálf83409d2017-11-08 20:56:57 +0100407
Jakub Josefa63f9862018-01-11 17:58:38 +0100408 stage('Install Kubernetes control') {
Oleh Hryhorov2a63aa62018-06-22 17:26:41 +0300409 orchestrate.installKubernetesControl(venvPepper, extra_tgt)
Anton Samoylove53f9382019-01-23 20:22:26 +0400410 if (common.checkContains('STACK_INSTALL', 'contrail')) {
411 orchestrate.checkContrailApiReadiness(venvPepper, extra_tgt)
412 }
Ruslan Kamaldinov65144322017-08-02 15:16:55 +0400413
Jakub Josefa63f9862018-01-11 17:58:38 +0100414 // collect artifacts (kubeconfig)
Oleh Hryhorov2a63aa62018-06-22 17:26:41 +0300415 writeFile(file: 'kubeconfig', text: salt.getFileContent(venvPepper, "I@kubernetes:master and *01* ${extra_tgt}", '/etc/kubernetes/admin-kube-config'))
Jakub Josefa63f9862018-01-11 17:58:38 +0100416 archiveArtifacts(artifacts: 'kubeconfig')
vrovachev7be1e962017-07-05 13:28:26 +0400417 }
418
Svimbaa554ea02018-06-06 18:45:23 +0200419 if (common.checkContains('STACK_INSTALL', 'contrail')) {
420 stage('Install Contrail compute') {
Oleh Hryhorov2a63aa62018-06-22 17:26:41 +0300421 orchestrate.installContrailCompute(venvPepper, extra_tgt)
Svimbaa554ea02018-06-06 18:45:23 +0200422 }
423 }
424
Jakub Josefa63f9862018-01-11 17:58:38 +0100425 stage('Install Kubernetes computes') {
426 if (common.validInputParam('STACK_COMPUTE_COUNT')) {
427 if (STACK_COMPUTE_COUNT > 0) {
428 if (STACK_TYPE == 'aws') {
429 // get stack info
430 def scaling_group = aws.getOutputs(venv, aws_env_vars, STACK_NAME, 'ComputesScalingGroup')
431
432 //update autoscaling group
433 aws.updateAutoscalingGroup(venv, aws_env_vars, scaling_group, ["--desired-capacity " + STACK_COMPUTE_COUNT])
434
435 // wait for computes to boot up
436 aws.waitForAutoscalingInstances(venv, aws_env_vars, scaling_group)
437 sleep(60)
438
439 } else if (STACK_TYPE == 'heat') {
440 envParams.put('cluster_node_count', STACK_COMPUTE_COUNT)
441
442 openstack.createHeatStack(openstackCloud, STACK_NAME, STACK_TEMPLATE, envParams, HEAT_STACK_ENVIRONMENT, venv, "update")
443 sleep(60)
444 }
445
446 }
447 }
448
Oleh Hryhorov2a63aa62018-06-22 17:26:41 +0300449 orchestrate.installKubernetesCompute(venvPepper, extra_tgt)
Svimbaa979f8f2018-09-26 11:24:49 +0200450 // Setup kubernetes addons for opencontrail. More info in the definition of the func.
451 orchestrate.setupKubeAddonForContrail(venvPepper, extra_tgt)
Jakub Josefa63f9862018-01-11 17:58:38 +0100452 }
Vasyl Saienkocdf8b292019-03-05 10:56:29 +0200453 orchestrate.installKubernetesClient(venvPepper, extra_tgt)
Ruslan Kamaldinov65144322017-08-02 15:16:55 +0400454 }
Ales Komarek24097402017-05-22 16:28:10 +0200455
Mykyta Karpin5b7c2602018-09-11 17:47:20 +0300456 // install ceph
457 if (common.checkContains('STACK_INSTALL', 'ceph')) {
458 stage('Install Ceph MONs') {
459 orchestrate.installCephMon(venvPepper, "I@ceph:mon ${extra_tgt}", extra_tgt)
460 }
461
462 stage('Install Ceph OSDs') {
463 orchestrate.installCephOsd(venvPepper, "I@ceph:osd ${extra_tgt}", true, extra_tgt)
464 }
465
466 stage('Install Ceph clients') {
467 orchestrate.installCephClient(venvPepper, extra_tgt)
468 }
469 }
470
Vasyl Saienkoc562fc42018-12-15 22:19:28 +0200471 // install docker swarm
472 orchestrate.installDockerSwarm(venvPepper, extra_tgt)
473
Jakub Josefa63f9862018-01-11 17:58:38 +0100474 // install openstack
475 if (common.checkContains('STACK_INSTALL', 'openstack')) {
Oleksii Grudevd3d5fad2018-06-29 16:25:35 +0300476 // install control, tests, ...
Jakub Josefa63f9862018-01-11 17:58:38 +0100477 stage('Install OpenStack control') {
Oleh Hryhorov2a63aa62018-06-22 17:26:41 +0300478 orchestrate.installOpenstackControl(venvPepper, extra_tgt)
Jakub Josefa63f9862018-01-11 17:58:38 +0100479 }
480
Oleg Iurchenko86f1a842018-02-13 22:18:28 +0200481 // Workaround for PROD-17765 issue to prevent crashes of keystone.role_present state.
482 // More details: https://mirantis.jira.com/browse/PROD-17765
Ivan Berezovskiyddd0cbb2019-08-01 15:23:14 +0400483 salt.restartSaltMinion(venvPepper, "I@keystone:client ${extra_tgt}")
Denis Egorenko14fa6e12019-08-23 14:29:34 +0400484 salt.minionsReachable(venvPepper, 'I@salt:master', 'I@keystone:client ${extra_tgt}', null, 10, 6)
Oleg Iurchenko86f1a842018-02-13 22:18:28 +0200485
Jakub Josefa63f9862018-01-11 17:58:38 +0100486 stage('Install OpenStack network') {
487
488 if (common.checkContains('STACK_INSTALL', 'contrail')) {
Oleh Hryhorov2a63aa62018-06-22 17:26:41 +0300489 orchestrate.installContrailNetwork(venvPepper, extra_tgt)
Anton Samoylove53f9382019-01-23 20:22:26 +0400490 orchestrate.checkContrailApiReadiness(venvPepper, extra_tgt)
Jakub Josefa63f9862018-01-11 17:58:38 +0100491 } else if (common.checkContains('STACK_INSTALL', 'ovs')) {
Oleh Hryhorov2a63aa62018-06-22 17:26:41 +0300492 orchestrate.installOpenstackNetwork(venvPepper, extra_tgt)
Jakub Josefa63f9862018-01-11 17:58:38 +0100493 }
494
Petr Jedinýefd668f2018-05-24 14:44:08 +0200495 // Wait for network to come up, 150s should be enough
496 common.retry(10, 15) {
Oleh Hryhorov2a63aa62018-06-22 17:26:41 +0300497 salt.cmdRun(venvPepper, "I@keystone:server ${extra_tgt}", '. /root/keystonercv3; openstack network list')
Petr Jedinýefd668f2018-05-24 14:44:08 +0200498 }
Jakub Josefa63f9862018-01-11 17:58:38 +0100499 }
500
Oleh Hryhorov2a63aa62018-06-22 17:26:41 +0300501 if (salt.testTarget(venvPepper, "I@ironic:conductor ${extra_tgt}")){
Jakub Josefa63f9862018-01-11 17:58:38 +0100502 stage('Install OpenStack Ironic conductor') {
Oleh Hryhorov2a63aa62018-06-22 17:26:41 +0300503 orchestrate.installIronicConductor(venvPepper, extra_tgt)
Jakub Josefa63f9862018-01-11 17:58:38 +0100504 }
505 }
506
Oleh Hryhorov2a63aa62018-06-22 17:26:41 +0300507 if (salt.testTarget(venvPepper, "I@manila:share ${extra_tgt}")){
Vasyl Saienkob800a0f2018-02-21 18:38:53 +0200508 stage('Install OpenStack Manila data and share') {
Oleh Hryhorov2a63aa62018-06-22 17:26:41 +0300509 orchestrate.installManilaShare(venvPepper, extra_tgt)
Vasyl Saienkob800a0f2018-02-21 18:38:53 +0200510 }
511 }
Jakub Josefa63f9862018-01-11 17:58:38 +0100512
513 stage('Install OpenStack compute') {
Denis Egorenkoca6aeca2019-08-19 19:41:27 +0400514 orchestrate.installOpenstackCompute(venvPepper, extra_tgt, batch_size)
Jakub Josefa63f9862018-01-11 17:58:38 +0100515
516 if (common.checkContains('STACK_INSTALL', 'contrail')) {
Oleh Hryhorov2a63aa62018-06-22 17:26:41 +0300517 orchestrate.installContrailCompute(venvPepper, extra_tgt)
Inessa Vasilevskaya30cb7312018-10-08 12:13:03 +0200518 orchestrate.installBackup(venvPepper, 'contrail', extra_tgt)
Jakub Josefa63f9862018-01-11 17:58:38 +0100519 }
520 }
521
522 }
523
Mykyta Karpin5b7c2602018-09-11 17:47:20 +0300524 // connect ceph
Jakub Josefa63f9862018-01-11 17:58:38 +0100525 if (common.checkContains('STACK_INSTALL', 'ceph')) {
Jakub Josefa63f9862018-01-11 17:58:38 +0100526
527 stage('Connect Ceph') {
Oleh Hryhorov2a63aa62018-06-22 17:26:41 +0300528 orchestrate.connectCeph(venvPepper, extra_tgt)
Jakub Josefa63f9862018-01-11 17:58:38 +0100529 }
530 }
531
532 if (common.checkContains('STACK_INSTALL', 'oss')) {
533 stage('Install Oss infra') {
Oleh Hryhorov2a63aa62018-06-22 17:26:41 +0300534 orchestrate.installOssInfra(venvPepper, extra_tgt)
Jakub Josefa63f9862018-01-11 17:58:38 +0100535 }
536 }
537
538 if (common.checkContains('STACK_INSTALL', 'cicd')) {
539 stage('Install Cicd') {
Oleh Hryhorov2a63aa62018-06-22 17:26:41 +0300540 orchestrate.installInfra(venvPepper, extra_tgt)
Oleh Hryhorov2a63aa62018-06-22 17:26:41 +0300541 orchestrate.installCicd(venvPepper, extra_tgt)
Jakub Josefa63f9862018-01-11 17:58:38 +0100542 }
543 }
544
545 if (common.checkContains('STACK_INSTALL', 'sl-legacy')) {
546 stage('Install StackLight v1') {
Oleh Hryhorov2a63aa62018-06-22 17:26:41 +0300547 orchestrate.installStacklightv1Control(venvPepper, extra_tgt)
548 orchestrate.installStacklightv1Client(venvPepper, extra_tgt)
Jakub Josefa63f9862018-01-11 17:58:38 +0100549 }
550 }
551
552 if (common.checkContains('STACK_INSTALL', 'stacklight')) {
553 stage('Install StackLight') {
Oleh Hryhorov2a63aa62018-06-22 17:26:41 +0300554 orchestrate.installStacklight(venvPepper, extra_tgt)
Jakub Josefa63f9862018-01-11 17:58:38 +0100555 }
556 }
557
558 if (common.checkContains('STACK_INSTALL', 'oss')) {
559 stage('Install OSS') {
560 if (!common.checkContains('STACK_INSTALL', 'stacklight')) {
561 // In case if StackLightv2 enabled containers already started
Oleh Hryhorov2a63aa62018-06-22 17:26:41 +0300562 salt.enforceState(venvPepper, "I@docker:swarm:role:master and I@devops_portal:config ${extra_tgt}", 'docker.client', true)
Jakub Josefa63f9862018-01-11 17:58:38 +0100563 }
Oleh Hryhorov2a63aa62018-06-22 17:26:41 +0300564 orchestrate.installOss(venvPepper, extra_tgt)
Jakub Josefa63f9862018-01-11 17:58:38 +0100565 }
566 }
567
568 //
569 // Test
570 //
571 def artifacts_dir = '_artifacts/'
572
573 if (common.checkContains('STACK_TEST', 'k8s')) {
574 stage('Run k8s conformance e2e tests') {
575 def image = TEST_K8S_CONFORMANCE_IMAGE
Victor Ryzhenkin723bd062018-12-11 17:09:06 +0400576 def autodetect = AUTODETECT
577 def ctl_target = 'I@kubernetes:master'
578 firstTarget = salt.getFirstMinion(venvPepper, ctl_target)
579 def containerd_enabled = salt.getPillar(
580 venvPepper, firstTarget, "kubernetes:common:containerd:enabled"
581 )["return"][0].values()[0].toBoolean()
582 if (containerd_enabled) {
583 def config = ['master': venvPepper,
584 'target': firstTarget,
585 'junitResults': true,
586 'autodetect': autodetect,
587 'image': image]
588 test.executeConformance(config)
589 } else {
590 def output_file = image.replaceAll('/', '-') + '.output'
Denis Egorenko14fa6e12019-08-23 14:29:34 +0400591 def target = "I@keystone:server:role:primary ${extra_tgt}"
Victor Ryzhenkin723bd062018-12-11 17:09:06 +0400592 def conformance_output_file = 'conformance_test.tar'
Jakub Josefa63f9862018-01-11 17:58:38 +0100593
Victor Ryzhenkin723bd062018-12-11 17:09:06 +0400594 // run image
595 test.runConformanceTests(venvPepper, target, TEST_K8S_API_SERVER, image)
Jakub Josefa63f9862018-01-11 17:58:38 +0100596
Victor Ryzhenkin723bd062018-12-11 17:09:06 +0400597 // collect output
598 sh "mkdir -p ${artifacts_dir}"
599 file_content = salt.getFileContent(venvPepper, target, '/tmp/' + output_file)
600 writeFile file: "${artifacts_dir}${output_file}", text: file_content
601 sh "cat ${artifacts_dir}${output_file}"
Jakub Josefa63f9862018-01-11 17:58:38 +0100602
Victor Ryzhenkin723bd062018-12-11 17:09:06 +0400603 // collect artifacts
604 archiveArtifacts artifacts: "${artifacts_dir}${output_file}"
vrovachevff3e72d2018-01-25 16:14:43 +0400605
Victor Ryzhenkin723bd062018-12-11 17:09:06 +0400606 // Copy test results
607 test.CopyConformanceResults(venvPepper, target, artifacts_dir, conformance_output_file)
608 }
Jakub Josefa63f9862018-01-11 17:58:38 +0100609 }
610 }
611
612 if (common.checkContains('STACK_TEST', 'openstack')) {
613 if (common.checkContains('TEST_DOCKER_INSTALL', 'true')) {
614 test.install_docker(venvPepper, TEST_TEMPEST_TARGET)
615 }
616 stage('Run OpenStack tests') {
617 test.runTempestTests(venvPepper, TEST_TEMPEST_IMAGE, TEST_TEMPEST_TARGET, TEST_TEMPEST_PATTERN)
618 }
619
620 stage('Copy Tempest results to config node') {
621 test.copyTempestResults(venvPepper, TEST_TEMPEST_TARGET)
622 }
623
624 stage('Archive rally artifacts') {
625 test.archiveRallyArtifacts(venvPepper, TEST_TEMPEST_TARGET)
Tomáš Kukrál74f92862017-06-05 19:18:43 +0200626 }
ibumarskov637a2152018-01-16 10:39:57 +0400627
628 if (common.validInputParam('TESTRAIL_REPORT') && TESTRAIL_REPORT.toBoolean()) {
629 stage('Upload test results to TestRail') {
630 def date = sh(script: 'date +%Y-%m-%d', returnStdout: true).trim()
631 def plan = TESTRAIL_PLAN ?: "[${TESTRAIL_MILESTONE}]System-Devcloud-${date}"
632 def group = TESTRAIL_GROUP ?: STACK_TEMPLATE
633
634 salt.cmdRun(venvPepper, TEST_TEMPEST_TARGET, "cd /root/rally_reports && cp \$(ls -t *xml | head -n1) report.xml")
635 test.uploadResultsTestrail("/root/rally_reports/report.xml",
636 TESTRAIL_REPORTER_IMAGE, group, TESTRAIL_QA_CREDENTIALS,
637 plan, TESTRAIL_MILESTONE, TESTRAIL_SUITE)
638 }
639 }
Ales Komarek24097402017-05-22 16:28:10 +0200640 }
641
Ales Komarek24097402017-05-22 16:28:10 +0200642
Jakub Josefa63f9862018-01-11 17:58:38 +0100643 if (common.checkContains('STACK_TEST', 'ceph')) {
644 stage('Run infra tests') {
645 sleep(120)
646 def cmd = "apt-get install -y python-pip && pip install -r /usr/share/salt-formulas/env/ceph/files/testinfra/requirements.txt && python -m pytest --junitxml=/root/report.xml /usr/share/salt-formulas/env/ceph/files/testinfra/"
647 salt.cmdRun(venvPepper, 'I@salt:master', cmd, false)
648 writeFile(file: 'report.xml', text: salt.getFileContent(venvPepper, 'I@salt:master', '/root/report.xml'))
649 junit(keepLongStdio: true, testResults: 'report.xml')
Martin Polreich46971102017-07-11 12:56:40 +0200650 }
651 }
652
Jakub Josefa63f9862018-01-11 17:58:38 +0100653 if (common.checkContains('STACK_TEST', 'opencontrail')) {
654 stage('Run opencontrail tests') {
655 def opencontrail_tests_dir = "/opt/opencontrail_test/fuel-plugin-contrail/plugin_test/vapor/"
656 def report_dir = "/opt/opencontrail-test-report/"
657 def cmd = ". ${opencontrail_tests_dir}exports.sh && " +
658 "cd ${opencontrail_tests_dir} && " +
659 "py.test --junit-xml=${report_dir}report.xml" +
660 " --html=${report_dir}report.html -v vapor/tests/ -k 'not destructive' "
Ruslan Kamaldinov65144322017-08-02 15:16:55 +0400661
Denis Egorenko14fa6e12019-08-23 14:29:34 +0400662 salt.runSaltProcessStep(venvPepper, 'I@salt:master', 'saltutil.refresh_pillar', [], null, true)
Jakub Josefa63f9862018-01-11 17:58:38 +0100663 salt.enforceState(venvPepper, 'I@opencontrail:test' , 'opencontrail.test' , true)
Jiri Broulikd01c42f2018-01-02 11:37:10 +0100664
Jakub Josefa63f9862018-01-11 17:58:38 +0100665 salt.cmdRun(venvPepper, 'I@opencontrail:test', cmd, false)
666
667 writeFile(file: 'report.xml', text: salt.getFileContent(venvPepper,
668 'I@opencontrail:test', "${report_dir}report.xml"))
669 junit(keepLongStdio: true, testResults: 'report.xml')
670 }
Jiri Broulikd01c42f2018-01-02 11:37:10 +0100671 }
672
673
Jakub Josefa63f9862018-01-11 17:58:38 +0100674 stage('Finalize') {
675 if (common.checkContains('STACK_INSTALL', 'finalize')) {
Oleh Hryhorov2a63aa62018-06-22 17:26:41 +0300676 def gluster_compound = "I@glusterfs:server ${extra_tgt}"
677 def salt_ca_compound = "I@salt:minion:ca:salt_master_ca ${extra_tgt}"
Dzmitry Stremkouskifa4c1632018-03-21 17:55:39 +0100678 // Enforce highstate asynchronous only on the nodes which are not glusterfs servers
Denis Egorenkoca6aeca2019-08-19 19:41:27 +0400679 salt.enforceHighstate(venvPepper, '* and not ' + gluster_compound + ' and not ' + salt_ca_compound, batch_size)
Dzmitry Stremkouskifa4c1632018-03-21 17:55:39 +0100680 // Iterate over nonempty set of gluster servers and apply highstates one by one
681 // TODO: switch to batch once salt 2017.7+ would be used
Dzmitry Stremkouski47a45122018-04-25 17:05:56 +0200682 def saltcaMinions = salt.getMinionsSorted(venvPepper, salt_ca_compound)
683 if ( !saltcaMinions.isEmpty() ) {
684 for ( target in saltcaMinions ) {
685 salt.enforceHighstate(venvPepper, target)
686 }
687 }
Dzmitry Stremkouskifa4c1632018-03-21 17:55:39 +0100688 def glusterMinions = salt.getMinionsSorted(venvPepper, gluster_compound)
689 if ( !glusterMinions.isEmpty() ) {
690 for ( target in glusterMinions ) {
691 salt.enforceHighstate(venvPepper, target)
692 }
693 }
Jakub Josefa63f9862018-01-11 17:58:38 +0100694 }
695
696 outputsPretty = common.prettify(outputs)
697 print(outputsPretty)
698 writeFile(file: 'outputs.json', text: outputsPretty)
699 archiveArtifacts(artifacts: 'outputs.json')
Jiri Broulikd01c42f2018-01-02 11:37:10 +0100700 }
701
Jakub Josefa63f9862018-01-11 17:58:38 +0100702 } catch (Throwable e) {
703 currentBuild.result = 'FAILURE'
704 throw e
705 } finally {
Jiri Broulikd01c42f2018-01-02 11:37:10 +0100706
Mikhail Ivanov3deb79a2017-12-06 17:44:47 +0400707
Jakub Josefa63f9862018-01-11 17:58:38 +0100708 //
709 // Clean
710 //
Ruslan Kamaldinov65144322017-08-02 15:16:55 +0400711
Jakub Josefa63f9862018-01-11 17:58:38 +0100712 if (common.validInputParam('STACK_NAME')) {
713 // send notification
714 common.sendNotification(currentBuild.result, STACK_NAME, ["slack"])
Ales Komarek24097402017-05-22 16:28:10 +0200715 }
716
Jakub Josefa63f9862018-01-11 17:58:38 +0100717 if (common.validInputParam('STACK_DELETE') && STACK_DELETE.toBoolean() == true) {
718 stage('Trigger cleanup job') {
719 common.errorMsg('Stack cleanup job triggered')
720 build(job: STACK_CLEANUP_JOB, parameters: [
721 [$class: 'StringParameterValue', name: 'STACK_NAME', value: STACK_NAME],
722 [$class: 'StringParameterValue', name: 'STACK_TYPE', value: STACK_TYPE],
723 [$class: 'StringParameterValue', name: 'OPENSTACK_API_URL', value: OPENSTACK_API_URL],
724 [$class: 'StringParameterValue', name: 'OPENSTACK_API_CREDENTIALS', value: OPENSTACK_API_CREDENTIALS],
725 [$class: 'StringParameterValue', name: 'OPENSTACK_API_PROJECT', value: OPENSTACK_API_PROJECT],
726 [$class: 'StringParameterValue', name: 'OPENSTACK_API_PROJECT_DOMAIN', value: OPENSTACK_API_PROJECT_DOMAIN],
727 [$class: 'StringParameterValue', name: 'OPENSTACK_API_PROJECT_ID', value: OPENSTACK_API_PROJECT_ID],
728 [$class: 'StringParameterValue', name: 'OPENSTACK_API_USER_DOMAIN', value: OPENSTACK_API_USER_DOMAIN],
729 [$class: 'StringParameterValue', name: 'OPENSTACK_API_CLIENT', value: OPENSTACK_API_CLIENT],
730 [$class: 'StringParameterValue', name: 'OPENSTACK_API_VERSION', value: OPENSTACK_API_VERSION]
731 ])
732 }
733 } else {
734 if (currentBuild.result == 'FAILURE') {
735 common.errorMsg("Deploy job FAILED and was not deleted. Please fix the problem and delete stack on you own.")
Vasyl Saienkoff24e582017-08-04 10:04:33 +0300736
Jakub Josefa63f9862018-01-11 17:58:38 +0100737 if (common.validInputParam('SALT_MASTER_URL')) {
738 common.errorMsg("Salt master URL: ${SALT_MASTER_URL}")
739 }
Ales Komarek24097402017-05-22 16:28:10 +0200740 }
741 }
742 }
743 }
744}