Merge branch 'cd-rakefile' of github.com:travis-ci/travis-api into cd-rakefile
This commit is contained in:
commit
f1b3101ac7
|
@ -17,7 +17,7 @@ This is the app running on https://api.travis-ci.org/
|
||||||
|
|
||||||
### Database setup
|
### 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`
|
1. `bundle exec rake db:create`
|
||||||
2. for testing 'RAILS_ENV=test bundle exec rake db:create --trace'
|
2. for testing 'RAILS_ENV=test bundle exec rake db:create --trace'
|
||||||
|
|
1
Rakefile
1
Rakefile
|
@ -1,5 +1,6 @@
|
||||||
namespace :db do
|
namespace :db do
|
||||||
env = ENV["RAILS_ENV"]
|
env = ENV["RAILS_ENV"]
|
||||||
|
fail "Cannot run rake db:create in production." if env == 'production'
|
||||||
desc "Create and migrate the #{env} database"
|
desc "Create and migrate the #{env} database"
|
||||||
task :create do
|
task :create do
|
||||||
sh "createdb travis_#{env}" rescue nil
|
sh "createdb travis_#{env}" rescue nil
|
||||||
|
|
Loading…
Reference in New Issue
Block a user