How to halt a Capistrano deploy from within a task
capistrano, ruby
Solution
You should raise a CommandError exception:
error = CommandError.new("An error that should abort and rollback deployment")
raise error
So no backtrace are shown.
Problem
I have a task that validates the integrity of the build that is about to be deployed. I would like to halt/fail the deploy in case it's broken. ``` task :test_build do if something puts "Problem with build" #prevent deploy to continue further end end after('deploy:update_code', 'test_build') ``` Note: Project uses `railsless-deploy`