Merge branch 'cd-rakefile' of github.com:travis-ci/travis-api into cd-rakefile

This commit is contained in:
carlad 2016-03-24 16:19:14 +01:00
commit f1b3101ac7
2 changed files with 2 additions and 1 deletions

View File

@ -17,7 +17,7 @@ This is the app running on https://api.travis-ci.org/
### Database setup
NB detail for how `rake` sets up the database can be found in the `Rakefile`. In the `namespace :db` block you will see the database name is configured according to the RAILS_ENV. If you are using a different configuration you will have to make your own adjustments.
NB detail for how `rake` sets up the database can be found in the `Rakefile`. In the `namespace :db` block you will see the database name is configured using the environment variable RAILS_ENV. If you are using a different configuration you will have to make your own adjustments.
1. `bundle exec rake db:create`
2. for testing 'RAILS_ENV=test bundle exec rake db:create --trace'

View File

@ -1,5 +1,6 @@
namespace :db do
env = ENV["RAILS_ENV"]
fail "Cannot run rake db:create in production." if env == 'production'
desc "Create and migrate the #{env} database"
task :create do
sh "createdb travis_#{env}" rescue nil