forked from External/greenlight
Updated script for start (#838)
This commit is contained in:
parent
6f3b8a0851
commit
7854485534
|
@ -43,3 +43,5 @@ env
|
|||
|
||||
config/terms.md
|
||||
coverage*
|
||||
|
||||
/atom-sftp-sync.json
|
||||
|
|
11
bin/start
11
bin/start
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue