xci: scripts: start-new-vm.sh: Print dib output when running on CI 63/43163/16
authorMarkos Chandras <mchandras@suse.de>
Tue, 26 Sep 2017 08:22:58 +0000 (09:22 +0100)
committerMarkos Chandras <mchandras@suse.de>
Wed, 27 Sep 2017 22:11:56 +0000 (23:11 +0100)
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 <mchandras@suse.de>
xci/scripts/vm/build-dib-os.sh
xci/scripts/vm/start-new-vm.sh

index 2f78800..78eaff2 100755 (executable)
@@ -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; }
index 807e1c0..cba1a39 100755 (executable)
@@ -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