blob: cf7e77d8ff8ad4b1ab9cff7d139fae4298ec4332 [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()
Tomáš Kukrál7db4e5f2017-01-13 11:58:34 +010019
20node {
21
22 // connection objects
23 def openstackCloud
24 def saltMaster
25
26 // value defaults
Tomáš Kukrál54e92882017-02-20 22:49:34 +010027 def openstackVersion = OPENSTACK_API_CLIENT ? OPENSTACK_API_CLIENT : 'liberty'
Tomáš Kukrál6ed03552017-02-20 22:55:24 +010028 def openstackEnv = "${env.WORKSPACE}/venv"
Tomáš Kukrál7db4e5f2017-01-13 11:58:34 +010029
Tomáš Kukrál7db4e5f2017-01-13 11:58:34 +010030 stage('Install OpenStack env') {
31 openstack.setupOpenstackVirtualenv(openstackEnv, openstackVersion)
32 }
33
34 stage('Connect to OpenStack cloud') {
35 openstackCloud = openstack.createOpenstackEnv(OPENSTACK_API_URL, OPENSTACK_API_CREDENTIALS, OPENSTACK_API_PROJECT)
36 openstack.getKeystoneToken(openstackCloud, openstackEnv)
37 }
38
39 stage('Delete Heat stack') {
40 openstack.deleteHeatStack(openstackCloud, HEAT_STACK_NAME, openstackEnv)
41 }
42
43}