Wait for database to be started before running MySQL client command
This commit is contained in:
parent
ad9ef4aba3
commit
13d6bf471d
1 changed files with 1 additions and 1 deletions
|
|
@ -31,7 +31,7 @@ user=$MYSQL_USER
|
|||
password=$MYSQL_PASSWORD
|
||||
ABC
|
||||
|
||||
if [ $(echo "show tables;" | mysql --host $DATABASE_HOST --port $DATABASE_PORT $MYSQL_DATABASE | wc -l) -le 1 ]; then
|
||||
if [ $(echo "show tables;" | dockerize -wait tcp://$DATABASE_HOST:$DATABASE_PORT -timeout 60s mysql --host $DATABASE_HOST --port $DATABASE_PORT $MYSQL_DATABASE | wc -l) -le 1 ]; then
|
||||
echo ">>> Initializing database..."
|
||||
dockerize -wait tcp://$DATABASE_HOST:$DATABASE_PORT -timeout 60s bundle exec rake db:schema:load
|
||||
fi
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue