summaryrefslogtreecommitdiffstats
path: root/res/docker/docker-entrypoint.sh
diff options
context:
space:
mode:
authorfujinhua <fu.jinhua@zte.com.cn>2018-08-08 16:00:50 +0800
committerfujinhua <fu.jinhua@zte.com.cn>2018-08-08 16:00:50 +0800
commit3b75ae19a25647785c81c02129bf12e0ed54e043 (patch)
treec9787d8d0437d35a20b1a5c12aba81c0c80530b9 /res/docker/docker-entrypoint.sh
parent278369e5fa6a7585df69af444c518503aa603740 (diff)
Remove DB and redis service from vnfres
Change-Id: If3b274d442bdde62a225c5fe02116af4f38a0509 Issue-ID: VFC-980 Signed-off-by: fujinhua <fu.jinhua@zte.com.cn>
Diffstat (limited to 'res/docker/docker-entrypoint.sh')
-rwxr-xr-xres/docker/docker-entrypoint.sh18
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