From 8f363650210b50aeb6e90807516161fd15dad079 Mon Sep 17 00:00:00 2001 From: Michiel Trimpe Date: Mon, 27 Oct 2014 16:07:26 +0100 Subject: [PATCH] Added extension hook for child images bootstrapping the database in case it's empty. --- 5.5/run.sh | 8 ++++++++ 5.6/run.sh | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/5.5/run.sh b/5.5/run.sh index cb950e0..ea13147 100644 --- a/5.5/run.sh +++ b/5.5/run.sh @@ -33,6 +33,14 @@ if [[ ! -d $VOLUME_HOME/mysql ]]; then echo "=> Done!" echo "=> Creating admin user ..." /create_mysql_admin_user.sh + if [ -e "/boostrap.sh" ]; then + echo "=> Starting MySQL ..." + StartMySQL + echo "=> Executing bootstrap script..." + /bootstrap.sh + echo "=> Completed bootstrapping ..." + mysqladmin -uroot shutdown + fi else echo "=> Using an existing volume of MySQL" fi diff --git a/5.6/run.sh b/5.6/run.sh index 95267b9..e9473d5 100644 --- a/5.6/run.sh +++ b/5.6/run.sh @@ -33,6 +33,14 @@ if [[ ! -d $VOLUME_HOME/mysql ]]; then echo "=> Done!" echo "=> Creating admin user ..." /create_mysql_admin_user.sh + if [ -e "/boostrap.sh" ]; then + echo "=> Starting MySQL ..." + StartMySQL + echo "=> Executing bootstrap script..." + /bootstrap.sh + echo "=> Completed bootstrapping ..." + mysqladmin -uroot shutdown + fi else echo "=> Using an existing volume of MySQL" fi