blob: d95c411d8e8ceae46c53570f1a8b47c1ba4f2dd0 [file] [log] [blame]
package com.mirantis.mcp_qa
/**
* Activate virtual environment and check k8s deployer is specified
*/
def prepareEnv() {
sh '''
if [ ! -r "${VENV_PATH}/bin/activate" ]; then
echo 'Python virtual environment not found! Set correct VENV_PATH!'
exit 1
fi
'''
sh '''
if [ ! -r "${WORKSPACE}/fuel-ccp-installer/${DEPLOY_SCRIPT_REL_PATH}" ]; then
echo "Deploy script \"${DEPLOY_SCRIPT_REL_PATH}\" not found in" \
"\"${WORKSPACE}/fuel-ccp-installer/\"!"
fi
'''
}
/**
* Destroy running environment
*/
def destroyEnv() {
if ( !(env.KEEP_BEFORE.equals('yes') || env.KEEP_BEFORE.equals('true')) ) {
sh '''
. ${VENV_PATH}/bin/activate
dos.py destroy ${ENV_NAME} || true
'''
}
}