Browse files

run whenever:update_crontab before deploy:resart because the symlink …

…task was renamed in a later versions of Cap making it impossible to be compatible with old and and new version using that task as a hook. close #213
  • Loading branch information...
1 parent 6f99128 commit fba25d3341fb688a44a2c79c9d62888a2b21fd1a @javan committed Feb 24, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/whenever/capistrano.rb
@@ -11,7 +11,7 @@
# Disable cron jobs at the begining of a deploy.
after "deploy:update_code", "whenever:clear_crontab"
# Write the new cron jobs near the end.
- after "deploy:symlink", "whenever:update_crontab"
+ before "deploy:restart", "whenever:update_crontab"
# If anything goes wrong, undo.
after "deploy:rollback", "whenever:update_crontab"

5 comments on commit fba25d3


What's wrong with deploy:finalize_update ?

javan commented on fba25d3 Mar 5, 2012

I don't know, what's right about deploy:finalize_update? ;)


It's the end of successful deployment, and marks the end of successul deploy, this is the place internally that log files, tempfiles, etc are touched, rotated, etc.

As the one who removed renamed the deploy:symlink task from Capistrano, I'd recommend finalize_update as the correct place to add callbacks.

I found this commit because I don't restart with Capistrano, I have monit watch the REVISION file, and gracefully restart services when it changes, and my crontab hasn't been getting installed.

What do you think? I'm also open to adding callbacks for this kind of thing to Capistrano, when there's common use cases such as this, I'd be more than happy to agree on more callback points.

javan commented on fba25d3 Mar 5, 2012

Cool, works for me. Thanks for the explanation!

gucki commented on fba25d3 May 9, 2012

It's still deploy:restart on master....?

Please sign in to comment.