From: Markos Chandras Date: Tue, 26 Sep 2017 08:22:58 +0000 (+0100) Subject: xci: scripts: start-new-vm.sh: Print dib output when running on CI X-Git-Tag: 6.0.0~293^2~2 X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F63%2F43163%2F16;p=releng-xci.git xci: scripts: start-new-vm.sh: Print dib output when running on CI Until we are able to fetch the dib images from external resources, we need to build them as part of the job. diskimage-builder can sometimes fail so we need to be able to see the log for debug purposes. Change-Id: Iab8bfba08daa7095cf76537f629c8e7bf6330b17 Signed-off-by: Markos Chandras --- diff --git a/xci/scripts/vm/build-dib-os.sh b/xci/scripts/vm/build-dib-os.sh index 2f788006..78eaff2d 100755 --- a/xci/scripts/vm/build-dib-os.sh +++ b/xci/scripts/vm/build-dib-os.sh @@ -7,7 +7,7 @@ # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## -set -ex +set -e # This only works on ubuntu hosts lsb_release -i | grep -q -i ubuntu || { echo "This script only works on Ubuntu distros"; exit 1; } diff --git a/xci/scripts/vm/start-new-vm.sh b/xci/scripts/vm/start-new-vm.sh index 807e1c0c..cba1a394 100755 --- a/xci/scripts/vm/start-new-vm.sh +++ b/xci/scripts/vm/start-new-vm.sh @@ -8,7 +8,7 @@ # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## -set -ex +set -e lsb_release -i | grep -q -i ubuntu || { echo "This script only works on Ubuntu distros"; exit 1; } @@ -46,7 +46,11 @@ while [[ $_retries -ne 0 ]]; do sleep 60 (( _retries = _retries - 1 )) else - $BASE_PATH/xci/scripts/vm/build-dib-os.sh ${OS} > build.log 2>&1 + if [[ -n ${JENKINS_HOME} ]]; then + $BASE_PATH/xci/scripts/vm/build-dib-os.sh ${OS} 2>&1 | tee build.log + else + $BASE_PATH/xci/scripts/vm/build-dib-os.sh ${OS} > build.log 2>&1 + fi break fi done