Merge pull request #397 from AyuntamientoMadrid/cache-tasks
Cache tasks
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
|
||||
12
lib/capistrano/tasks/cache.cap
Normal file
12
lib/capistrano/tasks/cache.cap
Normal 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
6
lib/tasks/cache.rake
Normal file
@@ -0,0 +1,6 @@
|
||||
namespace :cache do
|
||||
desc "Clears memcached"
|
||||
task clear: :environment do
|
||||
Rails.cache.clear
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user