Created
October 26, 2017 09:50
-
-
Save szromek/8ff81968e70806dfb1f4864af5bf914f to your computer and use it in GitHub Desktop.
Entrypoint for Ruby on Rails app on Docker
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/bash | |
bundle exec rake db:migrate | |
if [[ $? != 0 ]]; then | |
echo | |
echo "== Failed to migrate. Running setup first." | |
echo | |
bundle exec rake db:setup | |
fi | |
# Execute the given or default command: | |
exec "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
if for some reason bundle exec rake db:migrate - will fail with non zero return code
it will destroy your existing db