blob: b90770985a4c57054aaf7e82ff13334d9c813577 [file] [log] [blame]
Tomáš Kukrál7db4e5f2017-01-13 11:58:34 +01001/**
Tomáš Kukrálfc13aa32017-02-28 23:20:04 +01002 * DO NOT USE THIS PIPELINE, USE cleanup-pipeline.groovy
Tomáš Kukrál7db4e5f2017-01-13 11:58:34 +01003 *
4 * Launch heat stack with basic k8s
5 *
6 * Expected parameters:
Tomáš Kukrál7db4e5f2017-01-13 11:58:34 +01007 * OPENSTACK_API_URL OpenStack API address
8 * OPENSTACK_API_CREDENTIALS Credentials to the OpenStack API
9 * OPENSTACK_API_PROJECT OpenStack project to connect to
10 * OPENSTACK_API_CLIENT Versions of OpenStack python clients
11 * OPENSTACK_API_VERSION Version of the OpenStack API (2/3)
Tomáš Kukrál7db4e5f2017-01-13 11:58:34 +010012 * HEAT_STACK_NAME Heat stack name
Tomáš Kukrálcd30c972017-02-16 15:27:39 +010013 *
Tomáš Kukrál7db4e5f2017-01-13 11:58:34 +010014 */
15
Tomáš Kukrál54e92882017-02-20 22:49:34 +010016git = new com.mirantis.mk.Git()
17openstack = new com.mirantis.mk.Openstack()
18salt = new com.mirantis.mk.Salt()
Jakub Josefa63f9862018-01-11 17:58:38 +010019timeout(time: 12, unit: 'HOURS') {
20 node {
Tomáš Kukrál7db4e5f2017-01-13 11:58:34 +010021
Jakub Josefa63f9862018-01-11 17:58:38 +010022 // connection objects
23 def openstackCloud
24 def saltMaster
Tomáš Kukrál7db4e5f2017-01-13 11:58:34 +010025
Jakub Josefa63f9862018-01-11 17:58:38 +010026 // value defaults
27 def openstackVersion = OPENSTACK_API_CLIENT ? OPENSTACK_API_CLIENT : 'liberty'
Jakub Josef88aaf832018-01-18 16:18:28 +010028 def workspace = common.getWorkspace()
29 def openstackEnv = "${workspace}/venv"
Tomáš Kukrál7db4e5f2017-01-13 11:58:34 +010030
Jakub Josefa63f9862018-01-11 17:58:38 +010031 stage('Install OpenStack env') {
32 openstack.setupOpenstackVirtualenv(openstackEnv, openstackVersion)
33 }
Tomáš Kukrál7db4e5f2017-01-13 11:58:34 +010034
Jakub Josefa63f9862018-01-11 17:58:38 +010035 stage('Connect to OpenStack cloud') {
Jakub Josef88aaf832018-01-18 16:18:28 +010036 openstackCloud = openstack.createOpenstackEnv(openstackEnv, OPENSTACK_API_URL, OPENSTACK_API_CREDENTIALS, OPENSTACK_API_PROJECT)
Jakub Josefa63f9862018-01-11 17:58:38 +010037 openstack.getKeystoneToken(openstackCloud, openstackEnv)
38 }
39
40 stage('Delete Heat stack') {
41 openstack.deleteHeatStack(openstackCloud, HEAT_STACK_NAME, openstackEnv)
42 }
43
Tomáš Kukrál7db4e5f2017-01-13 11:58:34 +010044 }
Tomáš Kukrál7db4e5f2017-01-13 11:58:34 +010045}