X-Git-Url: https://gerrit.akraino.org/r/gitweb?a=blobdiff_plain;f=jjb%2Fiec%2Fiec-compass-build.sh;h=de560a645c762b320b381ee51181557215500322;hb=94fade00a59bad93684e419cb5fd12261d0fbd2f;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..de560a6 100755 --- a/jjb/iec/iec-compass-build.sh +++ b/jjb/iec/iec-compass-build.sh @@ -1,19 +1,57 @@ #!/bin/bash -set -e +set -ex + +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 +} + +checkout_arm64(){ + VERSION="dcc6d07" + git checkout ${VERSION} + sed -i 's:opnfv/:cyb70289/:' build/build-aarch64.yaml +} + +check_env echo "begin build compass" git clone https://github.com/opnfv/compass4nfv.git cd compass4nfv +if [ "$(uname -m)" = 'aarch64' ]; then + echo "Checkout compass4nfv to Arm64 version" + checkout_arm64 +fi + COMPASS_WORK_DIR=$WORKSPACE/../compass-work + mkdir -p $COMPASS_WORK_DIR ln -s $COMPASS_WORK_DIR work -sudo docker rm -f `docker ps | grep compass | cut -f1 -d' '` || true +sudo docker rm -f `sudo docker ps | grep compass | cut -f1 -d' '` || true -curl -s http://people.linaro.org/~yibo.cai/compass/compass4nfv-arm64-fixup.sh | bash || true +curl -sL http://people.linaro.org/~yibo.cai/compass/compass4nfv-arm64-fixup.sh | bash || true ./build.sh +# Fix permissions so we can archive log files before pushing to Nexus +sudo chown $(id -u):$(id -g) -R "${WORKSPACE}" + exit 0