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

Symlink tasks should happen on all roles, not just app

When deploying to multiple different roles, symlinks currently only
happen on the app role. When you then try and precompile assets on the
web role for example, the symlinks that it requires to link to certain
config files may not be there. This fix changes the default symlink
behaviour to happen on _all_ roles as this seems like a more sensible
default.
This commit is contained in:
Michael Smith 2013-11-13 08:35:16 +00:00
parent 5e1dba2a23
commit 6fd882c59e
2 changed files with 6 additions and 5 deletions

View file

@ -4,6 +4,7 @@ Reverse Chronological Order:
## `3.1.0` (not released) ## `3.1.0` (not released)
* Tasks that used `linked_dirs` and `linked_files` now run on all roles, not just app roles (@mikespokefire)
* Tasks `deploy:linked_dirs`, `deploy:make_linked_dirs`, `deploy:linked_files`, `deploy:cleanup_rollback`, * Tasks `deploy:linked_dirs`, `deploy:make_linked_dirs`, `deploy:linked_files`, `deploy:cleanup_rollback`,
`deploy:log_revision` and `deploy:revert_release` now use `release_roles()` not `roles()` meaning that they `deploy:log_revision` and `deploy:revert_release` now use `release_roles()` not `roles()` meaning that they
will only run on servers where the `no_release` property is not falsy. (@leehambley) will only run on servers where the `no_release` property is not falsy. (@leehambley)

View file

@ -49,7 +49,7 @@ namespace :deploy do
desc 'Check directories to be linked exist in shared' desc 'Check directories to be linked exist in shared'
task :linked_dirs do task :linked_dirs do
next unless any? :linked_dirs next unless any? :linked_dirs
on release_roles :app do on release_roles :all do
execute :mkdir, '-pv', linked_dirs(shared_path) execute :mkdir, '-pv', linked_dirs(shared_path)
end end
end end
@ -57,7 +57,7 @@ namespace :deploy do
desc 'Check directories of files to be linked exist in shared' desc 'Check directories of files to be linked exist in shared'
task :make_linked_dirs do task :make_linked_dirs do
next unless any? :linked_files next unless any? :linked_files
on release_roles :app do |host| on release_roles :all do |host|
execute :mkdir, '-pv', linked_file_dirs(shared_path) execute :mkdir, '-pv', linked_file_dirs(shared_path)
end end
end end
@ -65,7 +65,7 @@ namespace :deploy do
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 release_roles :app do |host| on release_roles :all do |host|
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)
@ -94,7 +94,7 @@ namespace :deploy do
desc 'Symlink linked directories' desc 'Symlink linked directories'
task :linked_dirs do task :linked_dirs do
next unless any? :linked_dirs next unless any? :linked_dirs
on release_roles :app do on release_roles :all do
execute :mkdir, '-pv', linked_dir_parents(release_path) execute :mkdir, '-pv', linked_dir_parents(release_path)
fetch(:linked_dirs).each do |dir| fetch(:linked_dirs).each do |dir|
@ -113,7 +113,7 @@ namespace :deploy do
desc 'Symlink linked files' desc 'Symlink linked files'
task :linked_files do task :linked_files do
next unless any? :linked_files next unless any? :linked_files
on release_roles :app do on release_roles :all do
execute :mkdir, '-pv', linked_file_dirs(release_path) execute :mkdir, '-pv', linked_file_dirs(release_path)
fetch(:linked_files).each do |file| fetch(:linked_files).each do |file|