title: Symfony Capifony Setting stage during deployment
body: <p>While deploying a Symfony application using Capifony I am having issues changing the stage while issuing commands. I would like to push my database from production to beta when deploying.</p>
  
  <p>This is my attempt at doing this. Here is the <code>beta.rb</code> file:</p>
  
  <pre><code>set :deploy_to, "/var/www/#{domain}/deploy/beta"
  
  after "deploy", "deploy:cleanup"
  
  # Move database from production to beta and dev
  # Set stage to production, move database to local
  set :stage, "prod"
  after "deploy", "database:move:to_local"
  
  # Set stage back to beta, move database to remote beta
  set :stage, "beta"
  after "deploy", "database:move:to_remote"
  </code></pre>
  
  <p>In the past I have stored the cap files outside of the project using capistrano and symfony &lt; 2 and used scripts to deal with stuff like this. With it now in the project it doesn't make sense to have scripts in the project.</p>
  
  <p>Am I able to change the stage on the fly when executing commands like this?  Or should I create a task to call an external script?</p>
  
  <p>Thanks!</p>