javan/whenever — pull request #188 by bradgessler (2011-10-15 00:07:10+00:00)
Title: More advanced capistrano role filtering

We needed to be able to deploy whenever jobs to a single server in capistrano with a cluster that consists of multiple servers:

role :worker, 'worker1.polleverywhere.com', :primary => true
role :worker, 'worker2.polleverywhere.com'

The existing Capistrano script would deploy the crontab to both servers. My enhancement allows an override:

set(:whenever_options) { {:roles => :worker, :except => { :no_release => true }, :only => {:primary => true}} } # We only want one system running crontabs from the worker poll.

while maintaining backwards compatibility with the simpler default deployment strategy.