Rebase: p/opnfv-fuel: Allow Fuel commit override.
[armband.git] / patches / opnfv-fuel / 0026-deploy.sh-accept-a-timeout-flag-T.patch
1 From: Josep Puigdemont <josep.puigdemont@enea.com>
2 Date: Mon, 9 May 2016 11:05:58 +0200
3 Subject: [PATCH] deploy.sh: accept a timeout flag (-T)
4
5 Signed-off-by: Josep Puigdemont <josep.puigdemont@enea.com>
6 ---
7  ci/deploy.sh | 19 +++++++++++++++----
8  1 file changed, 15 insertions(+), 4 deletions(-)
9
10 diff --git a/ci/deploy.sh b/ci/deploy.sh
11 index c9b836b..5f06a19 100755
12 --- a/ci/deploy.sh
13 +++ b/ci/deploy.sh
14 @@ -29,7 +29,7 @@ cat << EOF
15  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
16  `basename $0`: Deploys the Fuel@OPNFV stack
17  
18 -usage: `basename $0` -b base-uri [-B PXE Bridge] [-f] [-F] [-H] -l lab-name -p pod-name -s deploy-scenario [-S image-dir] -i iso
19 +usage: `basename $0` -b base-uri [-B PXE Bridge] [-f] [-F] [-H] -l lab-name -p pod-name -s deploy-scenario [-S image-dir] [-T timeout] -i iso
20         -s deployment-scenario [-S optional Deploy-scenario path URI]
21         [-R optional local relen repo (containing deployment Scenarios]
22  
23 @@ -46,6 +46,7 @@ OPTIONS:
24    -p  Pod-name
25    -s  Deploy-scenario short-name/base-file-name
26    -S  Storage dir for VM images
27 +  -T  Timeout, in minutes, for the deploy.
28    -i  iso url
29  
30  Description:
31 @@ -76,6 +77,8 @@ Input parameters to the build script is:
32     or a deployment short-name as defined by scenario.yaml in the deployment
33     scenario path.
34  -S Storage dir for VM images, default is fuel/deploy/images
35 +-T Timeout, in minutes, for the deploy. It defaults to using the DEPLOY_TIMEOUT
36 +   environment variable when defined, or to the default in deploy.py otherwise
37  -i .iso image to be deployed (needs to be provided in a URI
38     style, it can be a local resource: file:// or a remote resource http(s)://)
39  
40 @@ -111,6 +114,11 @@ FUEL_CREATION_ONLY=''
41  NO_DEPLOY_ENVIRONMENT=''
42  STORAGE_DIR=''
43  DRY_RUN=0
44 +if ! [ -z $DEPLOY_TIMEOUT ]; then
45 +    DEPLOY_TIMEOUT="-dt $DEPLOY_TIMEOUT"
46 +else
47 +    DEPLOY_TIMEOUT=""
48 +fi
49  #
50  # END of variables to customize
51  ############################################################################
52 @@ -118,7 +126,7 @@ DRY_RUN=0
53  ############################################################################
54  # BEGIN of main
55  #
56 -while getopts "b:B:dfFHl:p:s:S:i:he" OPTION
57 +while getopts "b:B:dfFHl:p:s:S:T:i:he" OPTION
58  do
59      case $OPTION in
60          b)
61 @@ -166,6 +174,9 @@ do
62                  STORAGE_DIR="-s ${OPTARG}"
63              fi
64              ;;
65 +        T)
66 +            DEPLOY_TIMEOUT="-dt ${OPTARG}"
67 +            ;;
68          i)
69              ISO=${OPTARG}
70              if [[ ! $ISO == file://* ]] && \
71 @@ -227,8 +238,8 @@ if [ $DRY_RUN -eq 0 ]; then
72          ISO=${SCRIPT_PATH}/ISO/image.iso
73      fi
74      # Start deployment
75 -    echo "python deploy.py $STORAGE_DIR $PXE_BRIDGE $USE_EXISTING_FUEL $FUEL_CREATION_ONLY $NO_HEALTH_CHECK $NO_DEPLOY_ENVIRONMENT -dea ${SCRIPT_PATH}/config/dea.yaml -dha ${SCRIPT_PATH}/config/dha.yaml -iso $ISO"
76 -    python deploy.py $STORAGE_DIR $PXE_BRIDGE $USE_EXISTING_FUEL $FUEL_CREATION_ONLY $NO_HEALTH_CHECK $NO_DEPLOY_ENVIRONMENT -dea ${SCRIPT_PATH}/config/dea.yaml -dha ${SCRIPT_PATH}/config/dha.yaml -iso $ISO
77 +    echo "python deploy.py $STORAGE_DIR $PXE_BRIDGE $USE_EXISTING_FUEL $FUEL_CREATION_ONLY $NO_HEALTH_CHECK $NO_DEPLOY_ENVIRONMENT -dea ${SCRIPT_PATH}/config/dea.yaml -dha ${SCRIPT_PATH}/config/dha.yaml -iso $ISO $DEPLOY_TIMEOUT"
78 +    python deploy.py $STORAGE_DIR $PXE_BRIDGE $USE_EXISTING_FUEL $FUEL_CREATION_ONLY $NO_HEALTH_CHECK $NO_DEPLOY_ENVIRONMENT -dea ${SCRIPT_PATH}/config/dea.yaml -dha ${SCRIPT_PATH}/config/dha.yaml -iso $ISO $DEPLOY_TIMEOUT
79  fi
80  popd > /dev/null
81