blob: 8b049900031386ca6b7690c883627f9fb836d233 [file] [log] [blame]
Tomáš Kukrálfc13aa32017-02-28 23:20:04 +01001/**
2 *
Jakub Josef4cb727e2017-04-19 16:44:47 +02003 * Delete heat stack pipeline
Tomáš Kukrálfc13aa32017-02-28 23:20:04 +01004 *
5 * Expected parameters:
6 * 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)
11 * HEAT_STACK_NAME Heat stack name
12 *
13 */
Jakub Joseff68c52a2017-04-20 17:47:37 +020014common = new com.mirantis.mk.Common()
Tomáš Kukrálfc13aa32017-02-28 23:20:04 +010015git = new com.mirantis.mk.Git()
16openstack = new com.mirantis.mk.Openstack()
17salt = new com.mirantis.mk.Salt()
18
19node {
20
21 // connection objects
22 def openstackCloud
Tomáš Kukrálfc13aa32017-02-28 23:20:04 +010023
24 // value defaults
25 def openstackVersion = OPENSTACK_API_CLIENT ? OPENSTACK_API_CLIENT : 'liberty'
26 def openstackEnv = "${env.WORKSPACE}/venv"
27
28 stage('Install OpenStack env') {
29 openstack.setupOpenstackVirtualenv(openstackEnv, openstackVersion)
30 }
31
32 stage('Connect to OpenStack cloud') {
33 openstackCloud = openstack.createOpenstackEnv(OPENSTACK_API_URL, OPENSTACK_API_CREDENTIALS, OPENSTACK_API_PROJECT)
34 openstack.getKeystoneToken(openstackCloud, openstackEnv)
35 }
36
37 stage('Delete Heat stack') {
Jakub Joseff68c52a2017-04-20 17:47:37 +020038 common.infoMsg("Deleting Heat Stack " + HEAT_STACK_NAME)
Tomáš Kukrálfc13aa32017-02-28 23:20:04 +010039 openstack.deleteHeatStack(openstackCloud, HEAT_STACK_NAME, openstackEnv)
40 }
41
42}