capistrano/capistrano — Issue #123: Disabling all callbacks on *and in* a task
Author: islandr
Created: 2011-11-03 22:20:11+00:00
State: open

I'm looking for a way to get quicker deploys by cutting out unnecessary callbacks on minor deploys. Sometimes I just want to push a small wording change to my staging server and it's awful having to sit through the bundling, asset precompiling, etc.

I thought I found the solution with `invoke_task_directly_without_callbacks` but it only disables the callbacks for the given task. Is there any way to disable callbacks for the given task **and** any subtasks within it?

For example, I'd like to be able to run `deploy:update_code` without all the baggage attached to the before/after callbacks attached to `deploy:finalize_update` which I can't prevent `update_code` from calling.

Here's what I tried:

```
namespace :deploy do
# For deploys that are just minor updates
# Trying to avoid: updating bundle, updating crontab, precompiling assets
task :minor do
invoke_task_directly_without_callbacks find_task("update_code")
invoke_task_directly_without_callbacks find_task("assets:symlink")
invoke_task_directly_without_callbacks find_task("symlink")
invoke_task_directly_without_callbacks find_task("restart")
end
end
```