Created
July 21, 2011 17:26
-
-
Save ianmurrays/1097695 to your computer and use it in GitHub Desktop.
Runs test locally before deploying on capistrano.
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
set :test_log, "logs/capistrano.test.log" | |
namespace :deploy do | |
before 'deploy:update_code' do | |
puts "--> Running tests, please wait ..." | |
unless system "bundle exec rake > #{test_log} 2>&1" #' > /dev/null' | |
puts "--> Tests failed. Run `cat #{test_log}` to see what went wrong." | |
exit | |
else | |
puts "--> Tests passed" | |
system "rm #{test_log}" | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Here is an updated version for capistrano3 / sshkit