summaryrefslogtreecommitdiffstats
path: root/jjb/3rd_party_ci/install-netvirt.sh
diff options
context:
space:
mode:
Diffstat (limited to 'jjb/3rd_party_ci/install-netvirt.sh')
-rwxr-xr-xjjb/3rd_party_ci/install-netvirt.sh40
1 files changed, 29 insertions, 11 deletions
diff --git a/jjb/3rd_party_ci/install-netvirt.sh b/jjb/3rd_party_ci/install-netvirt.sh
index f111d4847..ed1a12bc8 100755
--- a/jjb/3rd_party_ci/install-netvirt.sh
+++ b/jjb/3rd_party_ci/install-netvirt.sh
@@ -1,15 +1,33 @@
#!/bin/bash
-set -e
+set -o errexit
+set -o nounset
+set -o pipefail
-if [ -z ${WORKSPACE} ]; then
- echo "WORKSPACE is unset. Please do so."
- exit 1
-fi
-# wipe the WORKSPACE
-/bin/rm -rf $WORKSPACE/*
+SNAP_CACHE=$HOME/snap_cache
# 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
-./odl_reinstaller.sh --cloner-info $CLONER_INFO --odl-artifact $NETVIRT_ARTIFACT
-popd \ No newline at end of file
+
+if [ ! -f "/tmp/${NETVIRT_ARTIFACT}" ]; then
+ echo "ERROR: /tmp/${NETVIRT_ARTIFACT} specified as NetVirt Artifact, but file does not exist"
+ exit 1
+fi
+
+if [ ! -f "${SNAP_CACHE}/node.yaml" ]; then
+ echo "ERROR: node.yaml pod config missing in ${SNAP_CACHE}"
+ exit 1
+fi
+
+if [ ! -f "${SNAP_CACHE}/id_rsa" ]; then
+ echo "ERROR: id_rsa ssh creds missing in ${SNAP_CACHE}"
+ exit 1
+fi
+
+# TODO (trozet) snapshot should have already been unpacked into cache folder
+# but we really should check the cache here, and not use a single cache folder
+# for when we support multiple jobs on a single slave
+pushd sdnvpn/odl-pipeline/lib > /dev/null
+# FIXME (trozet) remove this once permissions are fixed in sdnvpn repo
+chmod +x odl_reinstaller.sh
+./odl_reinstaller.sh --pod-config ${SNAP_CACHE}/node.yaml \
+ --odl-artifact /tmp/${NETVIRT_ARTIFACT} --ssh-key-file ${SNAP_CACHE}/id_rsa
+popd > /dev/null