Tomáš Kukrál | 7db4e5f | 2017-01-13 11:58:34 +0100 | [diff] [blame] | 1 | /** |
Tomáš Kukrál | fc13aa3 | 2017-02-28 23:20:04 +0100 | [diff] [blame^] | 2 | * DO NOT USE THIS PIPELINE, USE cleanup-pipeline.groovy |
Tomáš Kukrál | 7db4e5f | 2017-01-13 11:58:34 +0100 | [diff] [blame] | 3 | * |
| 4 | * Launch heat stack with basic k8s |
| 5 | * |
| 6 | * Expected parameters: |
Tomáš Kukrál | 7db4e5f | 2017-01-13 11:58:34 +0100 | [diff] [blame] | 7 | * 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ál | 7db4e5f | 2017-01-13 11:58:34 +0100 | [diff] [blame] | 12 | * HEAT_STACK_NAME Heat stack name |
Tomáš Kukrál | cd30c97 | 2017-02-16 15:27:39 +0100 | [diff] [blame] | 13 | * |
Tomáš Kukrál | 7db4e5f | 2017-01-13 11:58:34 +0100 | [diff] [blame] | 14 | */ |
| 15 | |
Tomáš Kukrál | 54e9288 | 2017-02-20 22:49:34 +0100 | [diff] [blame] | 16 | git = new com.mirantis.mk.Git() |
| 17 | openstack = new com.mirantis.mk.Openstack() |
| 18 | salt = new com.mirantis.mk.Salt() |
Tomáš Kukrál | 7db4e5f | 2017-01-13 11:58:34 +0100 | [diff] [blame] | 19 | |
| 20 | node { |
| 21 | |
| 22 | // connection objects |
| 23 | def openstackCloud |
| 24 | def saltMaster |
| 25 | |
| 26 | // value defaults |
Tomáš Kukrál | 54e9288 | 2017-02-20 22:49:34 +0100 | [diff] [blame] | 27 | def openstackVersion = OPENSTACK_API_CLIENT ? OPENSTACK_API_CLIENT : 'liberty' |
Tomáš Kukrál | 6ed0355 | 2017-02-20 22:55:24 +0100 | [diff] [blame] | 28 | def openstackEnv = "${env.WORKSPACE}/venv" |
Tomáš Kukrál | 7db4e5f | 2017-01-13 11:58:34 +0100 | [diff] [blame] | 29 | |
Tomáš Kukrál | 7db4e5f | 2017-01-13 11:58:34 +0100 | [diff] [blame] | 30 | 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 | } |