From 6668fa4f4c1b660dc130775b3a3d8c38d6646e8d Mon Sep 17 00:00:00 2001 From: Tim Rozet Date: Thu, 26 May 2016 21:05:57 -0400 Subject: Apex: fixes env vars that cannot be exported due to sudo Change-Id: I2d27170c3797b1191dd39c3c9f6741a343acf70d Signed-off-by: Tim Rozet --- jjb/apex/apex-deploy.sh | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/jjb/apex/apex-deploy.sh b/jjb/apex/apex-deploy.sh index a5a4e8454..4706d45a8 100755 --- a/jjb/apex/apex-deploy.sh +++ b/jjb/apex/apex-deploy.sh @@ -71,9 +71,9 @@ if [[ "$BUILD_DIRECTORY" == *verify* ]]; then DEPLOY_SETTINGS_DIR="${WORKSPACE}/config/deploy" NETWORK_SETTINGS_DIR="${WORKSPACE}/config/network" DEPLOY_CMD="$(pwd)/deploy.sh" - export RESOURCES="${WORKSPACE}/build/images/" - export CONFIG="${WORKSPACE}/build" - export LIB="${WORKSPACE}/lib" + RESOURCES="${WORKSPACE}/build/images/" + CONFIG="${WORKSPACE}/build" + LIB="${WORKSPACE}/lib" # Make sure python34 deps are installed for dep_pkg in epel-release python34 python34-PyYAML python34-setuptools; do if ! rpm -q ${dep_pkg} > /dev/null; then @@ -114,16 +114,20 @@ else DEPLOY_CMD=opnfv-deploy DEPLOY_SETTINGS_DIR="/etc/opnfv-apex/" NETWORK_SETTINGS_DIR="/etc/opnfv-apex/" - export RESOURCES="/var/opt/opnfv/images" - export CONFIG="/var/opt/opnfv" + RESOURCES="/var/opt/opnfv/images" + CONFIG="/var/opt/opnfv" + LIB="/var/opt/opnfv/lib" fi +# set env vars to deploy cmd +DEPLOY_CMD="CONFIG=${CONFIG} RESOURCES=${RESOURCES} LIB=${LIB} ${DEPLOY_CMD}" + if [ "$OPNFV_CLEAN" == 'yes' ]; then - if [[ "$BUILD_DIRECTORY" == *verify* ]]; then - sudo ./clean.sh - else - sudo opnfv-clean - fi + if [[ "$BUILD_DIRECTORY" == *verify* ]]; then + sudo CONFIG=${CONFIG} LIB=${LIB} ./clean.sh + else + sudo CONFIG=${CONFIG} LIB=${LIB} opnfv-clean + fi fi echo "Deploy Scenario set to ${DEPLOY_SCENARIO}" -- cgit 1.2.3-korg