I just switched to using Capistrano 3 and ran into some issues with the before and after hooks documentation.
In the docs it show the following for calling existing tasks
before :starting, :ensure_user
after :finishing, :notify
If I use this syntax I get 'Don't know how to build task starting' Instead I had to do the following to get my tasks to work.
before "deploy:starting", "dj:stop"
after "deploy:finished", "dj:start"
The dj tasks are in Capistrano tasks directory in a *.rake file. Any ideas on what I may be missing or do the docs need to be updated?
Ruby 2.1.6 Rails 4.2.0 Capistrano 3.4.0
You can only use the shortcut version (before :starting, :ensure_user
) when both tasks are inside the same namespace. When you want to execute tasks from different namespaces, you need to include the namespace inside the string (before "deploy:starting", "dj:stop"
).
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