diff options
Diffstat (limited to 'res/docker/docker-entrypoint.sh')
-rwxr-xr-x | res/docker/docker-entrypoint.sh | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/res/docker/docker-entrypoint.sh b/res/docker/docker-entrypoint.sh index 214ae15..a4caa72 100755 --- a/res/docker/docker-entrypoint.sh +++ b/res/docker/docker-entrypoint.sh @@ -5,17 +5,18 @@ if [ -z "$SERVICE_IP" ]; then fi echo "SERVICE_IP=$SERVICE_IP" -if [ -z "$MYSQL_ROOT_PASSWORD" ]; then - export MYSQL_ROOT_PASSWORD="root" -fi -echo "MYSQL_ROOT_PASSWORD=$MYSQL_ROOT_PASSWORD" - if [ -z "$MSB_ADDR" ]; then echo "Missing required variable MSB_ADDR: Microservices Service Bus address <ip>:<port>" exit 1 fi echo "MSB_ADDR=$MSB_ADDR" +if [ -z "$MYSQL_ADDR" ]; then + echo "Missing required variable MYSQL_ADDR: <ip>:<port>" + exit 1 +fi +echo "MYSQL_ADDR=$MYSQL_ADDR" + # Wait for MSB initialization echo "Wait for MSB initialization" for i in {1..5}; do @@ -23,6 +24,13 @@ for i in {1..5}; do sleep $i done +# Wait for DB initialization +echo "Wait for DB initialization" +for i in {1..5}; do + curl -sS -m 1 $MYSQL_ADDR > /dev/null && break + sleep $i +done + # Configure service based on docker environment variables vfc/gvnfm/vnfres/res/docker/instance_config.sh |