From 986ae72349683e712b85ed75a26bc78aea579a0c Mon Sep 17 00:00:00 2001 From: Anthony Lin Date: Wed, 1 Nov 2017 14:59:14 +0000 Subject: [PATCH] Increase Query Time for deploy_site script It takes about 31 minutes to execute the drydock bare metal deployment in the CI/CD lab. There is a need to make the query time a variable that can be changed according to needs. This will help to reduce the volume of query response in logs. The default will be set to 90 seconds. User can change it by specifying the value of $1, i.e. $ tools/deploy_site.sh 180 There are some problems with the print outs of the final json results which is corrected here as well Change-Id: I7c6e2c5b3a23b4daf36cf78cec693899ba2cab5c --- tools/deploy_site.sh | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/tools/deploy_site.sh b/tools/deploy_site.sh index 4dfa9317..0a7c3ade 100755 --- a/tools/deploy_site.sh +++ b/tools/deploy_site.sh @@ -23,7 +23,10 @@ keystone_ip=`kubectl get pods -n ${namespace} -o wide | grep keystone | awk '{pr host="localhost" port=31901 -#Define Color +# Define query time and default to 90 seconds if not provided +query_time=${1:-90} + +# Define Color NC='\033[0m' RED='\033[0;31m' GREEN='\033[0;32m' @@ -77,7 +80,7 @@ do if [[ $action_lifecycle == "Complete" ]] || [[ $action_lifecycle == "Failed" ]] || [[ $action_lifecycle == "Paused" ]]; then # Print final results echo -e '\nFinal State of Deployment\n' - cat /tmp/get_action_status.json | jq + cat /tmp/get_action_status.json | jq . break else # Get Current State of Action Lifecycle @@ -92,9 +95,9 @@ do action_lifecycle=`cat /tmp/get_action_status.json | jq -r '.action_lifecycle'` - # Sleep for 10 seconds between each iteration - echo -e "Back Off for 10 seconds...\n" - sleep 10 + # Back off between each iteration + echo -e "Back Off for $query_time seconds...\n" + sleep $query_time # Check Dag state if [[ $action_lifecycle == "Failed" ]] || [[ $action_lifecycle == "Paused" ]]; then