Created
April 29, 2009 00:03
-
-
Save benschwarz/103486 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
desc "Reset and run test suite" | |
task :ci => ["environment:force:test", "gems:install", :environment] do | |
Rake::Task["db:reset"].invoke | |
Rake::Task["db:bootstrap"].invoke | |
Rake::Task["spec"].invoke | |
end | |
# For protecting production | |
namespace :environment do | |
task :development => :environment do | |
raise "Development mode only!" unless RAILS_ENV == 'development' | |
end | |
task :test => :environment do | |
raise "Test mode only!" unless RAILS_ENV == 'test' | |
end | |
namespace :force do | |
%w(test development production).each do |env| | |
task env.to_sym do | |
puts "******************************\n" | |
puts "* Running task in #{env} mode! *" | |
puts "******************************\n" | |
RAILS_ENV = env | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment