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
This commit is contained in:
Anthony Lin 2017-11-01 14:59:14 +00:00
parent 79f6584fa9
commit 986ae72349
1 changed files with 8 additions and 5 deletions

View File

@ -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