저는 capistrano-ext 보석의 다단계 모듈에 대해 다양한 범위의 문제를 겪고 있습니다. 현재 config/deploy/staging.rb
에 있습니다.Capistrano configuration
set(:settings) { YAML.load_file("config/deploy.yml")['staging'] }
set :repository, settings["repository"]
set :deploy_to, settings["deploy_to"]
set :branch, settings["branch"]
set :domain, settings["domain"]
set :user, settings["user"]
role :app, domain
role :web, domain
role :db, domain, :primary => true
내 config/deploy/production.rb
파일은 유사합니다. 이것은 매우 건조하지 않습니다. 이상적으로는 모든 것을 deploy.rb 파일에 넣고 싶습니다. 현재 단계에서 변수 세트가 있으면 모든 것이 정말 깨끗합니다.
업데이트 : 해결책을 찾았습니다.
나는deploy.rb
이 함수를 정의 :
def set_settings(params)
params.each_pair do |k,v|
set k.to_sym, v
end
if exists? :domain
role :app, domain
role :web, domain
role :db, domain, :primary => true
end
end
그런 다음 내
staging.rb
파일은
set_settings(YAML.load_file("config/deploy.yml")['staging'])
'$ cap staging deploy'를 입력하고 작동하도록 할 수있는 방법이 없습니까? – Eli