1
0
Fork 0
mirror of https://github.com/capistrano/capistrano synced 2023-03-27 23:21:18 -04:00

🐼 Split creation of linked files dirs from testing the files.

This commit is contained in:
Michael Nikitochkin 2013-09-25 17:04:35 +03:00 committed by Michael Nikitochkin
parent 2dc1627838
commit 1dde152801

View file

@ -35,6 +35,7 @@ namespace :deploy do
invoke "#{scm}:check" invoke "#{scm}:check"
invoke 'deploy:check:directories' invoke 'deploy:check:directories'
invoke 'deploy:check:linked_dirs' invoke 'deploy:check:linked_dirs'
invoke 'deploy:check:make_linked_dirs'
invoke 'deploy:check:linked_files' invoke 'deploy:check:linked_files'
end end
@ -54,11 +55,18 @@ namespace :deploy do
end end
end end
desc 'Check directories of files to be linked exist in shared'
task :make_linked_dirs do
next unless any? :linked_files
on roles :app do |host|
execute :mkdir, '-pv', linked_file_dirs(shared_path)
end
end
desc 'Check files to be linked exist in shared' desc 'Check files to be linked exist in shared'
task :linked_files do task :linked_files do
next unless any? :linked_files next unless any? :linked_files
on roles :app do |host| on roles :app do |host|
execute :mkdir, '-pv', linked_file_dirs(shared_path)
linked_files(shared_path).each do |file| linked_files(shared_path).each do |file|
unless test "[ -f #{file} ]" unless test "[ -f #{file} ]"
error t(:linked_file_does_not_exist, file: file, host: host) error t(:linked_file_does_not_exist, file: file, host: host)