asledzinskiy | e0948fd | 2017-01-06 16:23:54 +0200 | [diff] [blame^] | 1 | package com.mirantis.mcp-qa |
| 2 | |
| 3 | /** |
| 4 | * Activate virtual environment and check k8s deployer is specified |
| 5 | */ |
| 6 | |
| 7 | def 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 | |
| 27 | def 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 | } |