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)
5 Signed-off-by: Josep Puigdemont <josep.puigdemont@enea.com>
7 ci/deploy.sh | 19 +++++++++++++++----
8 1 file changed, 15 insertions(+), 4 deletions(-)
10 diff --git a/ci/deploy.sh b/ci/deploy.sh
11 index 3a95327..a8b3015 100755
14 @@ -29,7 +29,7 @@ cat << EOF
15 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
16 `basename $0`: Deploys the Fuel@OPNFV stack
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]
23 @@ -46,6 +46,7 @@ OPTIONS:
25 -s Deploy-scenario short-name/base-file-name
26 -S Storage dir for VM images
27 + -T Timeout, in minutes, for the deploy.
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
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)://)
40 @@ -114,6 +117,11 @@ FUEL_CREATION_ONLY=''
41 NO_DEPLOY_ENVIRONMENT=''
44 +if ! [ -z $DEPLOY_TIMEOUT ]; then
45 + DEPLOY_TIMEOUT="-dt $DEPLOY_TIMEOUT"
50 # END of variables to customize
51 ############################################################################
52 @@ -121,7 +129,7 @@ DRY_RUN=0
53 ############################################################################
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
61 @@ -169,6 +177,9 @@ do
62 STORAGE_DIR="-s ${OPTARG}"
66 + DEPLOY_TIMEOUT="-dt ${OPTARG}"
70 if [[ ! $ISO == file://* ]] && \
71 @@ -238,8 +249,8 @@ if [ $DRY_RUN -eq 0 ]; then
72 ISO=${SCRIPT_PATH}/ISO/image.iso
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