Created
December 28, 2017 21:35
-
-
Save oraposa/bb8d0b41b851e515e5f5d896c8026572 to your computer and use it in GitHub Desktop.
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
#entrypoint.sh | |
#!/bin/bash | |
cat docker_bashrc >> /root/.bashrc | |
# We want to see if they are trying to run a bash shell, | |
# if so skip the db migrate | |
echo "Options passed: $@" | |
if test "$1" != "bash" | |
then | |
# Do a database migration... | |
echo "Starting db migration" | |
bundle install # make sure we have everything we need | |
echo "Running rake db:migrate" | |
bin/rails db:migrate | |
if test $? -eq 0 ; then | |
echo "DB migration ended Succesfully" | |
else | |
echo "DB migration ended with errors" | |
fi | |
fi | |
exec "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment