Capistrano多阶段部署到错误的目录 [英] Capistrano Multistage deploying to wrong directory
问题描述
最近更新我的宝石后,我的capistrano设置出现问题。我有一个带有生产和暂存设置的多阶段设置。
Im having some problems with my capistrano setup after updating my gems lately. I have a multistage setup with a production and staging setup.
/config/deploy.rb
/config/deploy.rb
# setup multistage
set :stages, %w(testing production)
set :default_stage, "testing"
require 'capistrano/ext/multistage'
/config/deploy/production.rb
/config/deploy/production.rb
# Set deploy path
set :deploy_to, "/var/www/mysite/live"
set :rails_env, "production"
/config/deploy/testing.rb
/config/deploy/testing.rb
# Set deploy path
set :deploy_to, "/var/www/mysite/test"
set :rails_env, "test"
问题是它似乎忽略了我的deploy_to设置。它只是部署到默认的/ u / apps / mysite。
Problem is that it seems to ignore my deploy_to setting. It just deploys to the default /u/apps/mysite.
我不知道它是否具有相关性,所有原因都是从apache迁移而来+ nginx + unicorn的乘客。但我认为这与结帐没有任何关系。
I don't know if it has any relevance, the cause of all of this is a move from apache+passenger to nginx+unicorn. I don't think it has anything to do with that though, as this is just the checkout process.
推荐答案
我最终解决了通过将以下内容添加到我的deploy / production.rb和testing.rb
I eventually solved this by adding the following to my deploy/production.rb and testing.rb
set(:deploy_to) { "/var/www/#{application}/live" }
set(:releases_path) { File.join(deploy_to, version_dir) }
set(:shared_path) { File.join(deploy_to, shared_dir) }
set(:current_path) { File.join(deploy_to, current_dir) }
set(:release_path) { File.join(releases_path, release_name) }
这篇关于Capistrano多阶段部署到错误的目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!