Skip to content

Instantly share code, notes, and snippets.

@benschwarz
Created April 29, 2009 00:03
Show Gist options
  • Save benschwarz/103486 to your computer and use it in GitHub Desktop.
Save benschwarz/103486 to your computer and use it in GitHub Desktop.
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