diff --git a/Gemfile b/Gemfile index cb80bee96..ae3f05472 100644 --- a/Gemfile +++ b/Gemfile @@ -53,6 +53,7 @@ group :development do gem 'capistrano-git-with-submodules', '2.0.3' gem 'capistrano-service' gem 'awesome_print' + # gem 'listen', '~> 3.1.5' # gem 'spring-watcher-listen', '~> 2.0.0' # diff --git a/config/deploy.rb b/config/deploy.rb index e9cf1c38e..547faddba 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -32,5 +32,5 @@ namespace :deploy do after :publishing, 'service:pp_default:restart' after :publishing, 'service:pp_import:restart' - after :finishing, 'clear:cache' + after :published, 'deploy:clear_cache' end diff --git a/lib/capistrano/tasks/cache.rake b/lib/capistrano/tasks/cache.rake index 2c0edc97a..31cc451f2 100644 --- a/lib/capistrano/tasks/cache.rake +++ b/lib/capistrano/tasks/cache.rake @@ -1,12 +1,11 @@ -namespace :clear do - desc 'clear rails cache' - task :cache do - on roles(:app) do - within "#{current_path}" do - with rails_env: "#{fetch(:stage)}" do - execute :rake, "cache:clear" +namespace :deploy do + task :clear_cache do + on roles(:app) do |host| + with rails_env: fetch(:rails_env) do + within current_path do + execute :rake, "cache:clear" + end + end end - end end - end end