blob: 4df4f6486609cf6415d1797e5fcc645661132af2 [file] [log] [blame]
asledzinskiy69307da2017-01-19 16:37:16 +02001package com.mirantis.mcp_qa
asledzinskiye0948fd2017-01-06 16:23:54 +02002
3/**
4 * Activate virtual environment and check k8s deployer is specified
5 */
6
7def prepareEnv() {
8 sh '''
9 if [ ! -r "${VENV_PATH}/bin/activate" ]; then
10 echo 'Python virtual environment not found! Set correct VENV_PATH!'
11 exit 1
12 fi
13 '''
14
15 sh '''
16 if [ ! -r "${WORKSPACE}/fuel-ccp-installer/${DEPLOY_SCRIPT_REL_PATH}" ]; then
17 echo "Deploy script \"${DEPLOY_SCRIPT_REL_PATH}\" not found in" \
18 "\"${WORKSPACE}/fuel-ccp-installer/\"!"
19 fi
20 '''
21}
22
23/**
24 * Destroy running environment
25 */
26
27def destroyEnv() {
28 if ( !(env.KEEP_BEFORE.equals('yes') || env.KEEP_BEFORE.equals('true')) ) {
29 sh '''
30 . ${VENV_PATH}/bin/activate
31 dos.py destroy ${ENV_NAME} || true
32 '''
33 }
34}
asledzinskiyc4cd5b72017-01-25 16:50:56 +020035
36/**
37 * Erase running environment
38 */
39def eraseEnv() {
40 sh '''
41 . ${VENV_PATH}/bin/activate
42 dos.py erase ${ENV_NAME} || true
43 '''
44}
45