Skip to content
Permalink
6bb982f099
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
executable file 29 lines (26 sloc) 597 Bytes
#!/bin/sh
set -x
# Is MySQL available?
until nc -vz tier-demo-mysql 3306
do
echo "MySQL is unavailable - sleeping"
sleep 1
done
echo "MySQL is up!"
# Is this the containers first run?
# if so...bootstrap it.
# TODO: determine what happens if mysql container is not on its first run.
if [ -e /FIRSTRUN ]
then
rake db:create \
&& rake db:migrate \
&& rake db:seed \
&& rm -fv /FIRSTRUN
fi
# Do not start if we did not bootstrap
if [ ! -f /FIRSTRUN ]
then
bundle exec rails s -p 3000 -b '0.0.0.0'
else
echo "Bootstrap was not completed. Not starting..."
fi