Put the cruisecontrol stuff back in the cruise rake task, rather than a method.

This commit is contained in:
Raphael Sofaer 2011-07-02 10:54:42 -07:00
parent f4ca8898f6
commit a36bd9897f

View file

@ -2,7 +2,12 @@ namespace :cruise do
desc "Run all specs and features"
task :cruise => [:environment, :'cruise:migrate'] do
puts "Starting virtual display..."
run_cruise
`sh -e /etc/init.d/xvfb start`
puts "Starting specs..."
system('export DISPLAY=:99.0 && CI=true bundle exec rake')
exit_status = $?.exitstatus
puts "Stopping virtual display..."
`sh -e /etc/init.d/xvfb stop`
puts "Cleaning up..."
FileUtils.rm_rf("#{Rails.root}/public/uploads/images")
FileUtils.rm_rf("#{Rails.root}/public/uploads/tmp")
@ -22,14 +27,6 @@ namespace :cruise do
raise "#{cmd} failed!" unless $?.exitstatus == 0
end
end
def run_cruise
`sh -e /etc/init.d/xvfb start`
puts "Starting specs..."
system('export DISPLAY=:99.0 && CI=true bundle exec rake')
exit_status = $?.exitstatus
puts "Stopping virtual display..."
`sh -e /etc/init.d/xvfb stop`
end
end
task :cruise => "cruise:cruise"
task :travis => "cruise:travis"