English 中文(简体)
Capistrano 多阶段部署到错误的目录
原标题:Capistrano Multistage deploying to wrong directory

late晚更新我的宝石后,我 cap立了某些问题。 我有一个多阶段的建筑,有生产和固定。

/config/deploy.rb

# setup multistage
set :stages, %w(testing production)
set :default_stage, "testing"
require  capistrano/ext/multistage 

/config/deploy/production.rb

# Set deploy path
set :deploy_to, "/var/www/mysite/live"
set :rails_env, "production"

电话: 电话: 电话: 电话: 电话: @un.org

# Set deploy path
set :deploy_to, "/var/www/mysite/test"
set :rails_env, "test"

问题是,这似乎忽视了我的部署——确定情况。 它只是部署在违约/u/apps/mysite。

我不知道这是否具有任何关联性,其原因就是从乘车到gin子。 我并不认为它与这一点有任何关系,因为这只是检查过程。

最佳回答

我最终通过在我的部署/生产中增加以下内容来解决这一问题。 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) }
问题回答

我在Stack Overflow时对此 st。 它是一个老问题,但自其旗帜为开放的Im将射中。

我认为,这可能是一个范围问题,涉及Capistranoases如何装载。

我注意到这种生产中的 work。 rb和测试文件

 set :deploy_to, "/var/www/mysite/live"

但是,这确实是:

set(:deploy_to)  { "/var/www/#{application}/live" }

Its a subtle difference but I think the one that works is actually passing the information as a Proc block, whereas the first one is passing it as a string. I have a sneaky suspicion that by the time the Capistrano Instance comes into being that string is no longer present.

这将向我表明,如果你能够将这些档案中的部署变量确定下来,那么你的工作量就没有了,或者需要订购。 如果你能够表示,可以cheat,并围绕deploy/production.rbdeploy/test.rb。 法典

Capistrano::Configuration.instance.load do
  # variables, etc here
end

这无疑会告诉你,这份档案在Capistrano案的范围之内。

还有一点小点,但档案应当放在一起。

config/deploy # relative to your Rails app

不详

/config/deploy/ # this is an absolute path off of your root folder

Good Luck. 希望你们已经解决这个问题!

在该项目中,这些生产、rb和检测物在哪里?

确保他们在<代码>config/deploy下。





相关问题
rails collection_select vs. select

collection_select and select Rails helpers: Which one should I use? I can t see a difference in both ways. Both helpers take a collection and generates options tags inside a select tag. Is there a ...

SSL slowness in EC2

We ve deployed our rails app to EC2. In our setup, we have two proxies on small instances behind round-robin DNS. These run nginx load balancers for a dynamically growing and shrinking farm of web ...

Auth-code with A-Za-z0-9 to use in an URL parameter

As part of a web application I need an auth-code to pass as a URL parameter. I am currently using (in Rails) : Digest::SHA1.hexdigest((object_id + rand(255)).to_s) Which provides long strings like : ...

RubyCAS-Client question: Rails

I ve installed RubyCAS-Client version 2.1.0 as a plugin within a rails app. It s working, but I d like to remove the ?ticket= in the url. Is this possible?

activerecord has_many :through find with one sql call

I have a these 3 models: class User < ActiveRecord::Base has_many :permissions, :dependent => :destroy has_many :roles, :through => :permissions end class Permission < ActiveRecord::...

Ordering a hash to xml: Rails

I m building an xml document from a hash. The xml attributes need to be in order. How can this be accomplished? hash.to_xml

Text Editor for Ruby-on-Rails

guys which text editor is good for Rubyonrails? i m using Windows and i was using E-Texteditor but its not free n its expired now can anyone plese tell me any free texteditor? n which one is best an ...

How to get SQL queries for each user where env is production

I’m developing an application dedicated to generate statistical reports, I would like that user after saving their stat report they save sql queries too. To do that I wrote the following module: ...

热门标签