summaryrefslogtreecommitdiffstats
path: root/jjb/3rd_party_ci/install-netvirt.sh
diff options
context:
space:
mode:
authorNikolas Hermanns <nikolas.hermanns@ericsson.com>2016-12-14 15:18:16 +0100
committerNikolas Hermanns <nikolas.hermanns@ericsson.com>2017-01-13 13:56:57 +0100
commit3a4bd17dd35ef792903601a109fe7934728bcd3c (patch)
tree9d28bf5e3424f9337fae3ed5f599856e15c4d18d /jjb/3rd_party_ci/install-netvirt.sh
parentb2cc36d134c4e775398b2ecfbebc47161afed692 (diff)
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 <nikolas.hermanns@ericsson.com>
Diffstat (limited to 'jjb/3rd_party_ci/install-netvirt.sh')
-rwxr-xr-xjjb/3rd_party_ci/install-netvirt.sh7
1 files changed, 7 insertions, 0 deletions
diff --git a/jjb/3rd_party_ci/install-netvirt.sh b/jjb/3rd_party_ci/install-netvirt.sh
index 96c4b9634..f111d4847 100755
--- a/jjb/3rd_party_ci/install-netvirt.sh
+++ b/jjb/3rd_party_ci/install-netvirt.sh
@@ -1,5 +1,12 @@
#!/bin/bash
set -e
+
+if [ -z ${WORKSPACE} ]; then
+ echo "WORKSPACE is unset. Please do so."
+ exit 1
+fi
+# wipe the WORKSPACE
+/bin/rm -rf $WORKSPACE/*
# clone opnfv sdnvpn repo
git clone https://gerrit.opnfv.org/gerrit/p/sdnvpn.git $WORKSPACE/sdnvpn
. $WORKSPACE/sdnvpn/odl-pipeline/odl-pipeline-common.sh