From 3a4bd17dd35ef792903601a109fe7934728bcd3c Mon Sep 17 00:00:00 2001 From: Nikolas Hermanns Date: Wed, 14 Dec 2016 15:18:16 +0100 Subject: Avoid removing the whole file system If scripts are used by hand and WORKSPACE is not set then rm -rf /* will remove the filesystem. Change-Id: I9bb9ee6643d3916fedc7d3848ecf9b03bde10fae Signed-off-by: Nikolas Hermanns --- jjb/3rd_party_ci/postprocess-netvirt.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'jjb/3rd_party_ci/postprocess-netvirt.sh') diff --git a/jjb/3rd_party_ci/postprocess-netvirt.sh b/jjb/3rd_party_ci/postprocess-netvirt.sh index 2e99477c5..5baf378a9 100755 --- a/jjb/3rd_party_ci/postprocess-netvirt.sh +++ b/jjb/3rd_party_ci/postprocess-netvirt.sh @@ -1,14 +1,15 @@ #!/bin/bash set -e +if [ -z ${WORKSPACE} ]; then + echo "WORKSPACE is unset. Please do so." + exit 1 +fi # wipe the WORKSPACE -if [ -z ${WORKSPACE} ]; then echo "WORKSPACE is unset"; else echo "WORKSPACE is set to \"$WORKSPACE\""; fi -WORKSPACE=${WORKSPACE:-$PWD} /bin/rm -rf $WORKSPACE/* -set -e # clone opnfv sdnvpn repo git clone https://gerrit.opnfv.org/gerrit/p/sdnvpn.git $WORKSPACE/sdnvpn . $WORKSPACE/sdnvpn/odl-pipeline/odl-pipeline-common.sh pushd $LIB ./post_process.sh -popd \ No newline at end of file +popd -- cgit 1.2.3-korg