2

I am using whenever/capistrano in my deploy.rb to update crontab on deploy All I needed to do in my deploy script was to add these lines

set :whenever_command, "bundle exec whenever"
set :whenever_environment, defer {rails_env}
require "whenever/capistrano"

Hooks for whenever tasks are defined as follows

Capistrano::Configuration.instance(:must_exist).load do
  before "deploy:finalize_update", "whenever:update_crontab"
  after "deploy:rollback", "whenever:update_crontab"
end

Now i want to run the whenever:update_crontab task after migrations are run. I want the hook to be like

after "deploy:migrate", "whenever:update_crontab"

How do i overwrite the whenever hook?

usha
  • 28,973
  • 5
  • 72
  • 93

0 Answers0