namespace :memcached do
desc <<-DESC
Create memcached yaml in shared path.
- memcached_namespace
- memcached_ttl
- Defaults to @3600@
- memcached_readonly
- Defaults to @false@
- memcached_urlencode
- Defaults to @false@
- memcached_c_threshold
- Defaults to @10000@
- memcached_compression
- Defaults to @true@
- memcached_debug
- Defaults to @false@
- memcached_servers
- Defaults to @[ "localhost:11211" ]@
- memcached_yml_template
- Defaults to @"memcached/memcached.yml.erb"@
"Source":#{link_to_source(__FILE__)}
DESC
task :setup do
# Settings
fetch(:memcached_namespace)
fetch_or_default(:memcached_ttl, 3600)
fetch_or_default(:memcached_readonly, false)
fetch_or_default(:memcached_urlencode, false)
fetch_or_default(:memcached_c_threshold, 10000)
fetch_or_default(:memcached_compression, true)
fetch_or_default(:memcached_debug, false)
fetch_or_default(:memcached_servers, [ "localhost:11211" ])
fetch_or_default(:memcached_yml_template, "memcached/memcached.yml.erb")
put(memcached_yml_template, "#{shared_path}/config/memcached.yml")
end
desc "Symlink memcached configuration after deploy."
task :update_code, :roles => :app do
run "ln -nfs #{shared_path}/config/memcached.yml #{release_path}/config/memcached.yml"
end
end