开发者

Capistrano multistage variables

When using ext/multistage, why aren't the variables that are set in a stage (production.rb) available in deploy.rb?

In production.rb: set :domain, "domain.com"

In deploy.rb: set :vhost, "/var/www/#{domain}"

But when I try to run, it complains

undefined local variable or method `domain' for #<Capistra开发者_如何学Gono::Configuration:0x00000100d07248> (NameError)


This seems very silly, and I'm probably not doing this right, but it does work if I defer the variable setting in deploy.rb like this:

set(:stage_domain) { "#{domain}" }
set(:vhost) { "/var/www/#{stage_domain}" }
set(:repo_dir) { "#{vhost}/repository" }
set(:deploy_to) { "#{repo_dir}" }
set(:httpdocs_link) { "#{deploy_to}" }
role(:web) { stage_domain }
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜