I want to deploy my PHP application using Capistrano 3. My application uses Symfony 2 as a framework and Phing as a built system. I have installed capistrano-symfony so I can use Symfony commands from inside Capistrano.
The problem is that it also modified the deployment flow. Specifically, it adds two tasks here:
https://github.com/capistrano/symfony/blob/master/lib/capistrano/tasks/symfony.rake
after "deploy:updated", "deploy:clear_controllers"
after "deploy:updated", "deploy:assets:install"
Is there any way to remove these hooks from the flow again? These actions are already performed by my Phing build script (which is invoked by Capistrano). There is no need to run them again.
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).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With