On rollback

Definition
on_rollback(&block)
Module
Capistrano::Configuration::Execution
File
capistrano/configuration/execution.rb

This method specifies an on_rollback hook for the currently executing task. If this or any subsequent task then fails, and a transaction is active, this hook will be executed.

on_rollback { find_and_execute_task("deploy:stop") }
on_rollback { run "rm #{deploy_to}/shared/system/maintenance.html" }