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)
6 Change-Id: I58a7b9bc639bb03b994ea34fc317f5679140d9fd
7 Signed-off-by: Josep Puigdemont <josep.puigdemont@enea.com>
9 ci/deploy.sh | 19 +++++++++++++++----
10 1 file changed, 15 insertions(+), 4 deletions(-)
12 diff --git a/ci/deploy.sh b/ci/deploy.sh
13 index 4e4586c..8411714 100755
16 @@ -29,7 +29,7 @@ cat << EOF
17 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
18 `basename $0`: Deploys the Fuel@OPNFV stack
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]
25 @@ -47,6 +47,7 @@ OPTIONS:
27 -s Deploy-scenario short-name/base-file-name
28 -S Storage dir for VM images
29 + -T Timeout, in minutes, for the deploy.
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
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)://)
42 @@ -116,6 +119,11 @@ FUEL_CREATION_ONLY=''
43 NO_DEPLOY_ENVIRONMENT=''
46 +if ! [ -z $DEPLOY_TIMEOUT ]; then
47 + DEPLOY_TIMEOUT="-dt $DEPLOY_TIMEOUT"
52 # END of variables to customize
53 ############################################################################
54 @@ -123,7 +131,7 @@ DRY_RUN=0
55 ############################################################################
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
63 @@ -174,6 +182,9 @@ do
64 STORAGE_DIR="-s ${OPTARG}"
68 + DEPLOY_TIMEOUT="-dt ${OPTARG}"
72 if [[ ! $ISO == file://* ]] && \
73 @@ -243,8 +254,8 @@ if [ $DRY_RUN -eq 0 ]; then
74 ISO=${SCRIPT_PATH}/ISO/image.iso
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