From 1a855b2a9093c76eb430aea6bdd3db686c6d92c8 Mon Sep 17 00:00:00 2001 From: kikito Date: Mon, 7 Sep 2015 13:03:11 +0200 Subject: [PATCH 1/3] Fixes error which prevented executing `cap -T` --- config/deploy.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/deploy.rb b/config/deploy.rb index 5c1c73ff3..f09c199f9 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -3,7 +3,7 @@ lock '3.4.0' def deploysecret(key) @deploy_secrets_yml ||= YAML.load_file('config/deploy-secrets.yml')[fetch(:stage).to_s] - @deploy_secrets_yml[key.to_s] + @deploy_secrets_yml.fetch(key.to_s, 'undefined') end From d5754306450c030dfbb2db764a99add8e4425274 Mon Sep 17 00:00:00 2001 From: kikito Date: Mon, 7 Sep 2015 13:03:29 +0200 Subject: [PATCH 2/3] Adds rake task for clearing the cache --- lib/tasks/cache.rake | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 lib/tasks/cache.rake diff --git a/lib/tasks/cache.rake b/lib/tasks/cache.rake new file mode 100644 index 000000000..1d4b181d6 --- /dev/null +++ b/lib/tasks/cache.rake @@ -0,0 +1,6 @@ +namespace :cache do + desc "Clears memcached" + task clear: :environment do + Rails.cache.clear + end +end From 12bf3856c11785823a0031bac6de8fe065cc6005 Mon Sep 17 00:00:00 2001 From: kikito Date: Mon, 7 Sep 2015 13:15:56 +0200 Subject: [PATCH 3/3] adds a capistrano task to clear memcached easily --- lib/capistrano/tasks/cache.cap | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 lib/capistrano/tasks/cache.cap diff --git a/lib/capistrano/tasks/cache.cap b/lib/capistrano/tasks/cache.cap new file mode 100644 index 000000000..ce5bf88a2 --- /dev/null +++ b/lib/capistrano/tasks/cache.cap @@ -0,0 +1,12 @@ +namespace :cache do + desc "clears the cache in the servers" + task :clear do + on roles(:app) do |role| + within release_path do + with rails_env: fetch(:rails_env) do + execute :rake, "cache:clear" + end + end + end + end +end