I have a capistrano task I'd like to run twice during a deploy.
Specifically, I'd like to run a puma phased restart before I start deploying and after assets are compiled (part of capistrano-puma gem). The reason for running the phased restart before is to reduce memory usage to the point where the new asset compilation task (which starts a rails environment) does not cause the server to go into memory swap. We've been doing this manually, but sometimes forget.
If I add this to my deploy file:
before 'deploy:started', "puma:phased-restart"
Then my phased restarts are only run once and puma ends up running out of the wrong release directory.
How can I re-enable a capistrano task and allow it to run twice?