Merge "Apex: changing Gluon scenario name to noha"
[releng.git] / jjb / 3rd_party_ci / install-netvirt.sh
1 #!/bin/bash
2 set -e
3
4 if [ -z ${WORKSPACE} ]; then
5   echo "WORKSPACE is unset. Please set."
6   exit 1
7 fi
8 # wipe the WORKSPACE
9 /bin/rm -rf $WORKSPACE/*
10 set -o errexit
11 set -o nounset
12 set -o pipefail
13
14 SNAP_CACHE=$HOME/snap_cache
15 # clone opnfv sdnvpn repo
16 git clone https://gerrit.opnfv.org/gerrit/p/sdnvpn.git $WORKSPACE/sdnvpn
17
18 if [ ! -f "$NETVIRT_ARTIFACT" ]; then
19   echo "ERROR: ${NETVIRT_ARTIFACT} specified as NetVirt Artifact, but file does not exist"
20   exit 1
21 fi
22
23 # TODO (trozet) snapshot should have already been unpacked into cache folder
24 # but we really should check the cache here, and not use a single cache folder
25 # for when we support multiple jobs on a single slave
26 pushd sdnvpn/odl-pipeline/lib > /dev/null
27 ./odl_reinstaller.sh --pod-config ${SNAP_CACHE}/node.yaml \
28   --odl-artifact ${NETVIRT_ARTIFACT} --ssh-key-file ${SNAP_CACHE}/id_rsa
29 popd > /dev/null