Skip to content

Instantly share code, notes, and snippets.

@jherdman
Created November 4, 2010 15:53
Show Gist options
  • Save jherdman/662678 to your computer and use it in GitHub Desktop.
Save jherdman/662678 to your computer and use it in GitHub Desktop.
require 'whenever/capistrano'
##
# Force Whenever to use the Capistrano stage. We use a lambda to delay execution
# until absolutely necessary.
set :whenever_command, lambda { "whenever --set environment=#{fetch(:stage, 'production')}" }
@jherdman
Copy link
Author

jherdman commented Nov 4, 2010

Whenever actually comes with a very similar, and configurable, Capistrano task. What I'm doing in my gist is modifying their setting for the "whenever" executable so that it dynamically sets the environment to use based on the current Capistrano environment used (e.g. staging, dev, production).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment