I want to deploy different branchs of a Git repository on a same server.
I've updated app/config/deploy.rb
set :stage_dir, "app/config/deploy"
require "capistrano/ext/multistage"
set :stages, %w(prod stag stag2 stag3)
set :application, "MyApp"
I've created new files in app/config/deploy/
In app/config/deploy/stag.rb :
set :symfony_env_prod, "stag"
set :domain, "stag.example.com"
set :deploy_to, "/var/www/#{domain}"
# Other config
role :web, domain
role :app, domain
role :db, domain, :primary => true
In app/config/deploy/stag2.rb
set :symfony_env_prod, "stag"
set :domain, "stag2.example.com"
set :deploy_to, "/var/www/#{domain}"
# Other config
role :web, domain
role :app, domain
role :db, domain, :primary => true
I also launched cap stag2 deploy:setup
.
When I deploy using cap stag deploy
, stag.example.com is fine
Then, when I deploy cap stag2 deploy
,stag2.example.com is file but stag.example.com get some changes from stag2. The source files of stag.example.com are correct. I suppose that there is a cache conflict.
Is Capifony able to deploy the same app in a same server properly ?
Edit : sounds similar Capistrano Multistage deploying to wrong directory
I also tried with set :deploy_to, "/var/www/stag2/#{domain}"