Merge pull request #241 from travis-ci/cd-fix-rake-problem
add better condition check for rake
This commit is contained in:
commit
7ca67875b4
11
Rakefile
11
Rakefile
|
@ -1,10 +1,11 @@
|
|||
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
|
||||
sh "psql -q travis_#{env} < #{Gem.loaded_specs['travis-migrations'].full_gem_path}/db/structure.sql"
|
||||
if env != 'production'
|
||||
desc "Create and migrate the #{env} database"
|
||||
task :create do
|
||||
sh "createdb travis_#{env}" rescue nil
|
||||
sh "psql -q travis_#{env} < #{Gem.loaded_specs['travis-migrations'].full_gem_path}/db/structure.sql"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user