The documentation here (for Capistrano3) says to do this at the bottom of deploy.rb.
set :whenever_identifier, ->{ "#{fetch(:application)}_#{fetch(:stage)}" }
I've done this, but I do not understand how to "namespace the crontab entries." Can someone give me an example of how to do modify my schedule.rb to reflect this "namespace?" (I'm trying to get my whenever entries to NOT run in staging.)
Sorry if this is a stupid question, but I've tried about a half dozen things to make this work, but none of them seem to be up to date, and I can't find an example of this approach.
I have this, but it still creates crontab entries in staging with cap staging whenever:update_crontab:
set :output, "#{path}/log/whenever.log"
env "MAILTO", "david.krider@company.com"
namespace :widget_whammer_production do
every 1.week do
runner "FeaturizationNotificationJob.perform_now"
end
end
Additionally, when doing cap production deploy, I get this error:
/var/www/apps/widget_whammer/shared/bundle/ruby/2.5.0/gems/whenever-1.0.0/lib/whenever/job_list.rb:37:in `method_missing': undefined method `namespace'… from config/schedule.rb:25:in `initialize'
So something is different between cap <stage> deploy vs. cap <stage> whenever:<command>.
The documentation here (for Capistrano3) says to do this at the bottom of
deploy.rb.I've done this, but I do not understand how to "namespace the crontab entries." Can someone give me an example of how to do modify my
schedule.rbto reflect this "namespace?" (I'm trying to get my whenever entries to NOT run in staging.)Sorry if this is a stupid question, but I've tried about a half dozen things to make this work, but none of them seem to be up to date, and I can't find an example of this approach.
I have this, but it still creates crontab entries in staging with
cap staging whenever:update_crontab:Additionally, when doing
cap production deploy, I get this error:So something is different between
cap <stage> deployvs.cap <stage> whenever:<command>.