blob: 2a59bf68860991f80cab870119a8f35c30829caf [file] [log] [blame]
Tomáš Kukrál7db4e5f2017-01-13 11:58:34 +01001/**
2 *
3 * Launch heat stack with basic k8s
4 *
5 * Expected parameters:
Tomáš Kukrál7db4e5f2017-01-13 11:58:34 +01006 * OPENSTACK_API_URL OpenStack API address
7 * OPENSTACK_API_CREDENTIALS Credentials to the OpenStack API
8 * OPENSTACK_API_PROJECT OpenStack project to connect to
9 * OPENSTACK_API_CLIENT Versions of OpenStack python clients
10 * OPENSTACK_API_VERSION Version of the OpenStack API (2/3)
Tomáš Kukrál7db4e5f2017-01-13 11:58:34 +010011 * HEAT_STACK_NAME Heat stack name
Tomáš Kukrálcd30c972017-02-16 15:27:39 +010012 *
Tomáš Kukrál7db4e5f2017-01-13 11:58:34 +010013 */
14
Tomáš Kukrál54e92882017-02-20 22:49:34 +010015git = new com.mirantis.mk.Git()
16openstack = new com.mirantis.mk.Openstack()
17salt = new com.mirantis.mk.Salt()
Tomáš Kukrál7db4e5f2017-01-13 11:58:34 +010018
19node {
20
21 // connection objects
22 def openstackCloud
23 def saltMaster
24
25 // value defaults
Tomáš Kukrál54e92882017-02-20 22:49:34 +010026 def openstackVersion = OPENSTACK_API_CLIENT ? OPENSTACK_API_CLIENT : 'liberty'
Tomáš Kukrál6ed03552017-02-20 22:55:24 +010027 def openstackEnv = "${env.WORKSPACE}/venv"
Tomáš Kukrál7db4e5f2017-01-13 11:58:34 +010028
Tomáš Kukrál7db4e5f2017-01-13 11:58:34 +010029 stage('Install OpenStack env') {
30 openstack.setupOpenstackVirtualenv(openstackEnv, openstackVersion)
31 }
32
33 stage('Connect to OpenStack cloud') {
34 openstackCloud = openstack.createOpenstackEnv(OPENSTACK_API_URL, OPENSTACK_API_CREDENTIALS, OPENSTACK_API_PROJECT)
35 openstack.getKeystoneToken(openstackCloud, openstackEnv)
36 }
37
38 stage('Delete Heat stack') {
39 openstack.deleteHeatStack(openstackCloud, HEAT_STACK_NAME, openstackEnv)
40 }
41
42}