【发布时间】:2014-09-03 15:15:20
【问题描述】:
在 capistrano 3 文档 (http://capistranorb.com/documentation/advanced-features/remote-file/) 中提供了一个示例来说明此任务 (remote_file) 的工作原理
namespace :deploy do
namespace :check do
task :linked_files => 'config/newrelic.yml'
end
end
remote_file 'config/newrelic.yml' => '/tmp/newrelic.yml', roles: :app
file '/tmp/newrelic.yml' do |t|
sh "curl -o #{t.name} https://rpm.newrelic.com/accounts/xx/newrelic.yml"
end
他们告诉它允许将远程文件的存在设置为先决条件。 但是我仍然无法理解它是如何工作的,因为 remote_file 在任务代码之外被调用。它实际上是做什么的?谁能解释一下?
如果 config/newrelic.yml 不存在会发生什么以及 remote_file 调用如何连接 :linked_files 任务?
【问题讨论】: