Skip to content

Instantly share code, notes, and snippets.

@ctgswallow
Last active December 13, 2015 23:19
Show Gist options
  • Save ctgswallow/4991025 to your computer and use it in GitHub Desktop.
Save ctgswallow/4991025 to your computer and use it in GitHub Desktop.
desc "Configure Varnish cache module"
task :varnish, :roles => :publish do
run "cd #{latest_release}/docroot/sites/exacttarget ; drush dl -y varnish"
run "cd #{latest_release}/docroot/sites/exacttarget ; drush en -y varnish"
vcache = (find_servers :roles => :varnish).collect { |s| "#{s}:6080" }.join " "
vsettings = { "varnish_cache_clear" => "1",
"varnish_control_key" => :varnish_key.to_s,
"varnish_control_terminal" => "#{vcache}",
"varnish_flush_cron" => "0",
"varnish_socket_timeout" => "3600",
"varnish_version" => "3" }
vsettings.each do |k, v|
run %Q(cd #{latest_release}/docroot/sites/exacttarget ; drush vset #{k} "#{v}")
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment