Merge "QTIP OPNFV Docker Build issue fix"
[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 # create TMPDIR if it doesn't exist
13 export TMPDIR=$HOME/tmpdir
14 mkdir -p $TMPDIR
15
16 # change permissions down to TMPDIR
17 chmod a+x $HOME
18 chmod a+x $TMPDIR
19
20 # get the lab name from SLAVE_NAME
21 # we currently support ericsson and intel labs
22 LAB_NAME=${{SLAVE_NAME%%-*}}
23 if [[ ! "$LAB_NAME" =~ (ericsson|intel) ]]; then
24     echo "Unsupported/unidentified lab $LAB_NAME. Cannot continue!"
25     exit 1
26 else
27     echo "Using configuration for $LAB_NAME"
28 fi
29
30 # set CONFDIR, BRIDGE
31 CONFDIR=$WORKSPACE/deploy/templates/$LAB_NAME/virtual_environment/noha/conf
32 BRIDGE=pxebr
33
34 # log info to console
35 echo "Starting the deployment for a merged change using $INSTALLER_TYPE. This could take some time..."
36 echo "--------------------------------------------------------"
37 echo
38
39 # start the deployment
40 echo "Issuing command"
41 echo "sudo $WORKSPACE/ci/deploy.sh -iso $WORKSPACE/opnfv.iso -dea $CONFDIR/dea.yaml -dha $CONFDIR/dha.yaml -s $TMPDIR -b $BRIDGE -nh"
42
43 sudo $WORKSPACE/ci/deploy.sh -iso $WORKSPACE/opnfv.iso -dea $CONFDIR/dea.yaml -dha $CONFDIR/dha.yaml -s $TMPDIR -b $BRIDGE -nh
44
45 echo
46 echo "--------------------------------------------------------"
47 echo "Virtual deployment is done! Removing the intermediate files from artifact repo"
48
49 PROPERTIES_FILE=$(echo $OPNFV_ARTIFACT_URL | sed 's/iso/properties/')
50 gsutil rm gs://$OPNFV_ARTIFACT_URL
51 gsutil rm gs://$PROPERTIES_FILE