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