X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=jjb%2F3rd_party_ci%2Finstall-netvirt.sh;h=c9aa4c501126291f7e791c781de4b122ba465e05;hb=0bc0837faa8a942b5b2158e0c307cd4c1f09a3ac;hp=96c4b96342175585330705ccaf961412471c7afb;hpb=c6311f43a1d0bb366f9a789af49beb8c1fd9779e;p=releng.git diff --git a/jjb/3rd_party_ci/install-netvirt.sh b/jjb/3rd_party_ci/install-netvirt.sh index 96c4b9634..c9aa4c501 100755 --- a/jjb/3rd_party_ci/install-netvirt.sh +++ b/jjb/3rd_party_ci/install-netvirt.sh @@ -1,8 +1,29 @@ #!/bin/bash set -e + +if [ -z ${WORKSPACE} ]; then + echo "WORKSPACE is unset. Please set." + exit 1 +fi +# wipe the WORKSPACE +/bin/rm -rf $WORKSPACE/* +set -o errexit +set -o nounset +set -o pipefail + +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 "$NETVIRT_ARTIFACT" ]; then + echo "ERROR: ${NETVIRT_ARTIFACT} specified as NetVirt Artifact, but file does not exist" + 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 +./odl_reinstaller.sh --pod-config ${SNAP_CACHE}/node.yaml \ + --odl-artifact ${NETVIRT_ARTIFACT} --ssh-key-file ${SNAP_CACHE}/id_rsa +popd > /dev/null