blob: db5aa8ab67bebf878f6e548ea7a281811f3333df [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'
28 def openstackEnv = "${env.WORKSPACE}/venv"
Tomáš Kukrál7db4e5f2017-01-13 11:58:34 +010029
Jakub Josefa63f9862018-01-11 17:58:38 +010030 stage('Install OpenStack env') {
31 openstack.setupOpenstackVirtualenv(openstackEnv, openstackVersion)
32 }
Tomáš Kukrál7db4e5f2017-01-13 11:58:34 +010033
Jakub Josefa63f9862018-01-11 17:58:38 +010034 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
Tomáš Kukrál7db4e5f2017-01-13 11:58:34 +010043 }
Tomáš Kukrál7db4e5f2017-01-13 11:58:34 +010044}