Skip to content

Instantly share code, notes, and snippets.

@attilahorvath
Last active August 29, 2015 14:17
Show Gist options
  • Save attilahorvath/9799b8fc5a6a7a8c0afb to your computer and use it in GitHub Desktop.
Save attilahorvath/9799b8fc5a6a7a8c0afb to your computer and use it in GitHub Desktop.
Multistage Whenever configuration for Capistrano 3
# Capfile
require "whenever/capistrano"
# deploy.rb
set :whenever_environment, -> { fetch(:stage) }
set :whenever_identifier, -> { "#{fetch(:application)}_#{fetch(:stage)}" }
# schedule.rb
case @environment
when "staging"
# every 15.minutes do...
when "production"
# every 1.hour do...
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment