Permalink
Cannot retrieve contributors at this time
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?
canvas-demo-techex17/sis-app/run-rails.sh
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
executable file
29 lines (26 sloc)
597 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |