Which task is called after cap deploy:update_code fails?

capistrano, ruby-on-rails

Solution

This picture should help you, it's the order of executed tasks at deploy time:

Problem

I'm having a issue with capistrano in that when an update_code or symlink fails i need to change the permissions for some of the directories in the releases path (or work out how to make the rollback use sudo). I've tried before "deploy:rollback", task and before "deploy:rollback:code", task but neither of these seem to be run by update_code. Is that internal to the update_code task? I guess another option would be to make update_code -> rm -rf [releases] run as sudo.

Original source