From f61a01b504743ece2430b2b00dc2d4f79800fd9b Mon Sep 17 00:00:00 2001 From: Matthew Jones Date: Thu, 10 Sep 2015 09:32:01 -0400 Subject: [PATCH] Switch to using ansible wait_for instead of sleep In the startup script for docker-compose --- tools/docker-compose/start_development.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/docker-compose/start_development.sh b/tools/docker-compose/start_development.sh index f2267a85ce..9c7f23f063 100755 --- a/tools/docker-compose/start_development.sh +++ b/tools/docker-compose/start_development.sh @@ -1,7 +1,9 @@ #!/bin/bash -# We need to give the databases enough time to start up (switch to using ansible's wait_for here) -sleep 20 +# Wait for the databases to come up +ansible -i "127.0.0.1," -c local -v -m wait_for -a "host=postgres port=5432" all +ansible -i "127.0.0.1," -c local -v -m wait_for -a "host=redis port=6379" all +ansible -i "127.0.0.1," -c local -v -m wait_for -a "host=mongo port=27017" all # In case Tower in the container wants to connect to itself, use "docker exec" to attach to the container otherwise /etc/init.d/ssh start