Skip to content

Commit

Permalink
More advanced role filtering in Capistrano
Browse files Browse the repository at this point in the history
  • Loading branch information
Brad Gessler committed Oct 15, 2011
1 parent 94c375a commit 36992b7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/whenever/capistrano.rb
@@ -1,5 +1,6 @@
Capistrano::Configuration.instance(:must_exist).load do
_cset(:whenever_roles) { :db }
_cset(:whenever_options) { {:roles => fetch(:whenever_roles)} }
_cset(:whenever_command) { "whenever" }
_cset(:whenever_identifier) { fetch :application }
_cset(:whenever_environment) { fetch :rails_env, "production" }
Expand Down Expand Up @@ -28,7 +29,7 @@
which servers the crontab is updated on by setting the :whenever_roles variable.
DESC
task :update_crontab do
options = { :roles => fetch(:whenever_roles) }
options = fetch(:whenever_options)

if find_servers(options).any?
on_rollback do
Expand All @@ -55,7 +56,7 @@
the :whenever_roles variable.
DESC
task :clear_crontab do
options = { :roles => whenever_roles }
options = fetch(:whenever_options)
run "cd #{fetch :release_path} && #{fetch :whenever_command} #{fetch :whenever_clear_flags}", options if find_servers(options).any?
end
end
Expand Down

0 comments on commit 36992b7

Please sign in to comment.