X-Git-Url: https://gerrit.akraino.org/r/gitweb?a=blobdiff_plain;f=jjb%2Fiec%2Fiec-compass-build.sh;h=3a5e2d8d191e25a5891b0b2e22f823583470a4d6;hb=c591b7d8721361306a351c77d5fb96885efb178a;hp=64cea9ed9689c5592cbb57ae220b8b70409c6ef2;hpb=6f714fdac06a476b776a0019eef4ea7983a2253d;p=ci-management.git diff --git a/jjb/iec/iec-compass-build.sh b/jjb/iec/iec-compass-build.sh index 64cea9e..3a5e2d8 100755 --- a/jjb/iec/iec-compass-build.sh +++ b/jjb/iec/iec-compass-build.sh @@ -1,12 +1,36 @@ #!/bin/bash set -e +check_env(){ + #Checking python-pip software status. If failed, reinstall it. + set +e + sudo pip --version + CHECK_PIP_SUDO=$? + + pip --version + CHECK_PIP_USER=$? + set -e + + #Check command result, if failed, reinstall the pip + if [ ${CHECK_PIP_SUDO} -ne 0 ] || [ ${CHECK_PIP_USER} -ne 0 ]; then + echo "Reinstall pip" + sudo python -m pip uninstall -y pip + curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py + sudo python get-pip.py pip + rm get-pip.py + hash -r + fi +} + +check_env + echo "begin build compass" git clone https://github.com/opnfv/compass4nfv.git cd compass4nfv COMPASS_WORK_DIR=$WORKSPACE/../compass-work + mkdir -p $COMPASS_WORK_DIR ln -s $COMPASS_WORK_DIR work