forked from russ/lacquer
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
First shot at a capistrano deployment utility.
- Loading branch information
Showing
1 changed file
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |