Merge "run docker in sudo mode to pass key for apex"
[releng.git] / jjb / fuel / fuel-deploy-new.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 # set deployment parameters
18 BRIDGE=pxebr
19 export TMPDIR=$HOME/tmpdir
20 LAB_NAME=${NODE_NAME/-*}
21 POD_NAME=${NODE_NAME/*-}
22
23 # create TMPDIR if it doesn't exist
24 mkdir -p $TMPDIR
25
26 # change permissions down to TMPDIR
27 chmod a+x $HOME
28 chmod a+x $TMPDIR
29
30 # clone the securedlab repo
31 cd $WORKSPACE
32 echo "Cloning securedlab repo"
33 git clone ssh://jenkins-ericsson@gerrit.opnfv.org:29418/securedlab
34
35 # construct the command
36 DEPLOY_COMMAND="sudo $WORKSPACE/ci/deploy.sh -b file://$WORKSPACE/securedlab -l $LAB_NAME -p $POD_NAME -s $DEPLOY_SCENARIO -i $WORKSPACE/opnfv.iso -H -B $BRIDGE  -S $TMPDIR"
37
38 # log info to console
39 echo "Deployment parameters"
40 echo "Scenario: $DEPLOY_SCENARIO"
41 echo "--------------------------------------------------------"
42 echo "Lab: $LAB_NAME"
43 echo "POD: $POD_NAME"
44 echo "ISO: $(echo $OPNFV_ARTIFACT_URL | cut -d'/' -f3)"
45 echo
46 echo "Starting the deployment using $INSTALLER_TYPE. This could take some time..."
47 echo "--------------------------------------------------------"
48 echo
49
50 # start the deployment
51 echo "Issuing command"
52 echo "$DEPLOY_COMMAND"
53 echo
54
55 $DEPLOY_COMMAND
56
57 echo
58 echo "--------------------------------------------------------"
59 echo "Done!"