저는 Capistrano를 처음 사용합니다.Capistrano : fetch 메소드가 deploy.rb 시작 부분에 값을 반환하지 않습니다.
기본적으로 deploy_to 경로에서 사용자로부터받은 클라이언트 이름을 사용하고 싶습니다.
set :client, ask('client name','demo')
fetch :client`
은 그럼 값을가 해결되지 않는
Unfortunatellyset :deploy_to, '/php/ca/stg/#{fetch :client}/#{fetch :application}'
set :shared_directory, '/php/ca/stg/#{fetch :client}/shared'
가져 오기로 deploy_to 설정합니다. 경로에 # {fetch : client} 같이 머물러 있습니다.
그러나 작업이 완벽하게 해결됩니다. 예 :
before :starting, :check_branch do
run_locally do
unless execute :git, 'ls-remote --exit-code', fetch(:repo_url), fetch(:branch), { raise_on_non_zero_exit: false }
fatal "Specified branch or tag #{fetch(:branch)} for client #{fetch(:client)} does not exist in remote repository."
exit 1
end
end
end
내가 누락되었거나이 방법의 작동 방식을 이해하지 못합니다. 내가 말했듯이 저는 카피스트라노로 시작했습니다. 내 Laravel 응용 프로그램을 배포하는 데 사용하려고합니다.
사용자의 입력을 사용하여 동적 변수를 설정하는 해결책은 무엇입니까?
감사합니다.
매트 감사합니다. 스크립트가 더 이상 실행되고 "요청"을 기다리지 않는다는 것을 알지 못했습니다. Deffered 참조가 잘 작동했습니다. –