From 6fd882c59e268b5edfb630d4415e8e07cfe41f7d Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Wed, 13 Nov 2013 08:35:16 +0000 Subject: [PATCH] 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. --- CHANGELOG.md | 1 + lib/capistrano/tasks/deploy.rake | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fe3d20c1..f1443958 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ Reverse Chronological Order: ## `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`, `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) diff --git a/lib/capistrano/tasks/deploy.rake b/lib/capistrano/tasks/deploy.rake index 9f508bc6..0ae23c21 100644 --- a/lib/capistrano/tasks/deploy.rake +++ b/lib/capistrano/tasks/deploy.rake @@ -49,7 +49,7 @@ namespace :deploy do desc 'Check directories to be linked exist in shared' task :linked_dirs do next unless any? :linked_dirs - on release_roles :app do + on release_roles :all do execute :mkdir, '-pv', linked_dirs(shared_path) end end @@ -57,7 +57,7 @@ namespace :deploy do desc 'Check directories of files to be linked exist in shared' task :make_linked_dirs do 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) end end @@ -65,7 +65,7 @@ namespace :deploy do desc 'Check files to be linked exist in shared' task :linked_files do next unless any? :linked_files - on release_roles :app do |host| + on release_roles :all do |host| linked_files(shared_path).each do |file| unless test "[ -f #{file} ]" error t(:linked_file_does_not_exist, file: file, host: host) @@ -94,7 +94,7 @@ namespace :deploy do desc 'Symlink linked directories' task :linked_dirs do next unless any? :linked_dirs - on release_roles :app do + on release_roles :all do execute :mkdir, '-pv', linked_dir_parents(release_path) fetch(:linked_dirs).each do |dir| @@ -113,7 +113,7 @@ namespace :deploy do desc 'Symlink linked files' task :linked_files do next unless any? :linked_files - on release_roles :app do + on release_roles :all do execute :mkdir, '-pv', linked_file_dirs(release_path) fetch(:linked_files).each do |file|