Merge pull request #397 from AyuntamientoMadrid/cache-tasks

Cache tasks
This commit is contained in:
Raimond Garcia
2015-09-07 13:23:03 +02:00
3 changed files with 19 additions and 1 deletions

View File

@@ -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

View File

@@ -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

6
lib/tasks/cache.rake Normal file
View File

@@ -0,0 +1,6 @@
namespace :cache do
desc "Clears memcached"
task clear: :environment do
Rails.cache.clear
end
end