mirror of
https://github.com/capistrano/capistrano
synced 2023-03-27 23:21:18 -04:00
ba0d313440
The commit introduces a `remote_file` task, allowing the existence of a remote file to be set as a prerequisite. These tasks can in turn depend on local files if required. In this implementation, the fact that we're dealing with a file in the shared path is assumed. As as example, this task can be used to ensure that files to be linked exist before running the `check:linked_files` task: 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
11 lines
232 B
Text
11 lines
232 B
Text
namespace :deploy do
|
|
namespace :check do
|
|
task :linked_files => 'config/database.yml'
|
|
end
|
|
end
|
|
|
|
remote_file 'config/database.yml' => '/tmp/database.yml', roles: :all
|
|
|
|
file '/tmp/database.yml' do |t|
|
|
sh "touch #{t.name}"
|
|
end
|