title: How to pass arguments to mina deploy tool
body: <p>We are using <a href="http://nadarei.co/mina/" rel="nofollow">Mina</a> to deploy our Rails4 app after switching from Capistrano. On cap we could do <code>cap production deploy:invoke task="namespace:taskname"</code> where invoke task was a custom deploy task that took arguments to execute a specified rake task on a given environment.</p>
  
  <p>How to pass arguments to mina to run specified rake tasks?
  So far the closest to argument passing in mina I have seen is <code>mina deploy to=staging</code>. 
  I am looking for usage close to <code>mina invoke namespace:taskname</code> that would cd into app's /current directory and do a <code>bundle exec rake namespace:taskname</code>.</p>
  
  <p>This seems simple enough, what am I missing?</p>
  
  <p><strong>Edit</strong>
  As per Guy Teube's suggestion in /config/deploy.rb I now have</p>
  
  <pre><code>set :task, ENV['TASK']
  set :current, "#{deploy_to}/current"
  
  desc "Invokes a raketask"
  task :invoke =&gt; :environment do
    queue "cd #{current} &amp;&amp; bundle exec rake #{task}"
  end
  </code></pre>
  
  <p>Running <code>mina invoke TASK=old:votes --simulate</code> does not work yet, outputs "<code>cd /home/deployer/apps/manabalss/current &amp;&amp; bundle exec rake</code>"
  (Notice the string terminating without TASK environmental variable not having been taken into account.</p>