Skip to content

Commit

Permalink
First shot at a capistrano deployment utility.
Browse files Browse the repository at this point in the history
  • Loading branch information
russ committed Apr 25, 2011
1 parent e76362a commit 6075795
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions lib/lacquer/capistrano.rb
@@ -0,0 +1,30 @@
# Capistrano task for Lacquer

Capistrano::Configuration.instance(:must_exit).load do
_cset(:lacquer_roles) { :web }

after "deploy:web:disable", "varnish:global_purge"
after "deploy:web:enable", "varnish:global_purge"
after "deploy:update", "varnish:restart"

namespace :lacquer do
desc <<-DESC
Manage the varnishd server.
Available commands are:
lacquer:start
lacquer:stop
lacquer:restart
lacquer:global_purge
lacquer:status
DESC

%w( start stop restart global_purge status ).each do |name|
task(name.to_sym), :roles => lacquer_roles do
next if find_servers_for_task(current_task).empty?
Rake::Task["varnishd:#{name}"].invoke
end
end
end
end

0 comments on commit 6075795

Please sign in to comment.