From f6a885ffabd77ef9abb80c49d65772c97d9aee1e Mon Sep 17 00:00:00 2001 From: Markos Chandras Date: Tue, 26 Sep 2017 09:22:58 +0100 Subject: 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 --- xci/scripts/vm/build-dib-os.sh | 2 +- xci/scripts/vm/start-new-vm.sh | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) 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 -- cgit 1.2.3-korg