Updated script for start (#838)

This commit is contained in:
Jesus Federico 2019-10-15 12:15:45 -04:00 committed by GitHub
parent 6f3b8a0851
commit 7854485534
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 3 deletions

2
.gitignore vendored
View File

@ -43,3 +43,5 @@ env
config/terms.md
coverage*
/atom-sftp-sync.json

View File

@ -8,10 +8,15 @@ if [ "$RAILS_ENV" = "production" ] && [ "$DB_ADAPTER" = "postgresql" ]; then
done
fi
bundle exec rake db:create
db_create=$(RAILS_ENV=$RAILS_ENV bundle exec rake db:create)
echo $db_create
if ! bundle exec rake db:migrate ; then
export DB_MIGRATE_FAILED=1
if [[ $db_create == *"ERROR"* ]]; then
echo ">>> Database migration"
bundle exec rake db:migrate
else
echo ">>> Database initialization"
bundle exec rake db:setup
fi
bundle exec rake assets:precompile