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.
This is my attempt at doing this. Here is the beta.rb
file:
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"
In the past I have stored the cap files outside of the project using capistrano and symfony < 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.
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?
Thanks!