blob: 03a6a1b6fd90600330255286feadc843fcc7a76d [file] [log] [blame]
asledzinskiye0948fd2017-01-06 16:23:54 +02001package com.mirantis.mcp-qa
2
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}