How to pass arguments to Capistrano 3 tasks in deploy.rb
capistrano, capistrano3
Solution
Not sure about `before/after`, but with `Capistrano 3` you can always use the `rake` syntax and call task from within another task:
Rake::Task["mynamespace:mytask"].invoke(arg)
Problem
Here is an tutorial how to pass parameters to an capistrano 3 task. ``` namespace :task do desc 'Execute the specific cmd task' task :invoke, :command do |task, args| on roles(:app) do execute :cmd, args[:command] end end end ``` Can executed with: ``` $ cap staging "task:invoke[arg]" ``` How can i use this in my deploy.rb? The following does not work. ``` before :started, "task:invoke[arg]" ```