Remove hook from flow in Capistrano 3 Remove hook from flow in Capistrano 3 symfony symfony

Remove hook from flow in Capistrano 3


Finally figured it out, partially. I can remove named before hooks, but not before blocks or after hooks (because they are converted to a block inside Rake). I added this to my deploy.rb:

Rake::Task['deploy:updated'].prerequisites.delete('composer:install')

I figured out that I didn't need any of the after hooks, so I simply cleared them:

Rake::Task['deploy:updated'].actions.clear()

The only thing I can't figure out yet is how to clear specific after hooks, because they end up as blocks (i.e. anonymous functions).


You could just clear the task itself;

Rake::Task["deploy:clear_controllers"].clear

This way the action will still be invoked, but without any effect.