apex: fixes path for network_settings with bm deploy
[releng.git] / jjb / fuel / fuel-deploy-virtual.sh
1 #!/bin/bash
2 set -o errexit
3 set -o nounset
4 set -o pipefail
5
6 # source the file so we get OPNFV vars
7 source latest.properties
8
9 # echo the info about artifact that is used during the deployment
10 echo "Using $(echo $OPNFV_ARTIFACT_URL | cut -d'/' -f3) for deployment"
11
12 # checkout the commit that was used for building the downloaded artifact
13 # to make sure the ISO and deployment mechanism uses same versions
14 echo "Checking out $OPNFV_GIT_SHA1"
15 git checkout $OPNFV_GIT_SHA1 --quiet
16
17 # create TMPDIR if it doesn't exist
18 export TMPDIR=$HOME/tmpdir
19 mkdir -p $TMPDIR
20
21 # change permissions down to TMPDIR
22 chmod a+x $HOME
23 chmod a+x $TMPDIR
24
25 # get the lab name from SLAVE_NAME
26 # we currently support ericsson and intel labs
27 LAB_NAME=${NODE_NAME%%-*}
28 if [[ ! "$LAB_NAME" =~ (ericsson|intel) ]]; then
29     echo "Unsupported/unidentified lab $LAB_NAME. Cannot continue!"
30     exit 1
31 else
32     echo "Using configuration for $LAB_NAME"
33 fi
34
35 # set CONFDIR, BRIDGE
36 CONFDIR=$WORKSPACE/deploy/templates/$LAB_NAME/virtual_environment/noha/conf
37 BRIDGE=pxebr
38
39 # log info to console
40 echo "Starting the deployment for a merged change using $INSTALLER_TYPE. This could take some time..."
41 echo "--------------------------------------------------------"
42 echo
43
44 # start the deployment
45 echo "Issuing command"
46 echo "sudo $WORKSPACE/ci/deploy.sh -iso $WORKSPACE/opnfv.iso -dea $CONFDIR/dea.yaml -dha $CONFDIR/dha.yaml -s $TMPDIR -b $BRIDGE -nh"
47
48 sudo $WORKSPACE/ci/deploy.sh -iso $WORKSPACE/opnfv.iso -dea $CONFDIR/dea.yaml -dha $CONFDIR/dha.yaml -s $TMPDIR -b $BRIDGE -nh
49
50 echo
51 echo "--------------------------------------------------------"
52 echo "Virtual deployment is done! Removing the intermediate files from artifact repo"
53
54 PROPERTIES_FILE=$(echo $OPNFV_ARTIFACT_URL | sed 's/iso/properties/')
55 gsutil rm gs://$OPNFV_ARTIFACT_URL
56 gsutil rm gs://$PROPERTIES_FILE