0

I am new to webistrano so apologies if this is a trivial matter...

I am using webistrano to deploy php code to several production servers, this is all working great. My problem is that I need to clear HTML cache on my cache servers (varnish cache) after the code update. I can't figure out how to build a recipe that will be executed on the webistrano machine (and will run the relevant shell script that will clear the cache) and not on each of the deployment target machines.

Thanks for the help,

Yariv

Funk Forty Niner
  • 74,450
  • 15
  • 68
  • 141

2 Answers2

0

Simpliest method is to execute varnishadm tool with proper parameters inside deploy:restart

  set :varnish_ban_pattern, "req.url ~ ^/"
  set :varnish_terminal_address_port, "127.0.0.1:6082"
  set :varnish_varnishadm, "/usr/bin/varnishadm"

  task :restart, :roles => :web do
    run "#{varnish_varnishadm} -T #{varnish_terminal_address_port} ban \"#{varnish_ban_pattern}\"" 
  end
ghloogh
  • 1,634
  • 16
  • 9
0

Thanks for the answer. I actually need to do some more stuf than to only clear the the cache so I will execute a bash script locally as described in below: How do I execute a Capistrano task locally?

Community
  • 1
  • 1