title: How to pass arguments to Capistrano 3 tasks in deploy.rb
body: <p><a href="http://www.jetthoughts.com/tech/2013/09/26/capistrano-3-passing-parameters-to-your-task.html">Here</a> is an tutorial how to pass parameters to an capistrano 3 task.</p>
  
  <pre><code>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
  </code></pre>
  
  <p>Can executed with:</p>
  
  <pre><code>$ cap staging "task:invoke[arg]"
  </code></pre>
  
  <p>How can i use this in my deploy.rb? The following does not work.</p>
  
  <pre><code>before :started, "task:invoke[arg]"
  </code></pre>