Skip to content
This repository
Browse code

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...
commit fba25d3341fb688a44a2c79c9d62888a2b21fd1a 1 parent 6f99128
Javan Makhmali authored February 23, 2012

Showing 1 changed file with 1 addition and 1 deletion. Show diff stats Hide diff stats

  1. 2  lib/whenever/capistrano.rb
2  lib/whenever/capistrano.rb
@@ -11,7 +11,7 @@
11 11
   # Disable cron jobs at the begining of a deploy.
12 12
   after "deploy:update_code", "whenever:clear_crontab"
13 13
   # Write the new cron jobs near the end.
14  
-  after "deploy:symlink", "whenever:update_crontab"
  14
+  before "deploy:restart", "whenever:update_crontab"
15 15
   # If anything goes wrong, undo.
16 16
   after "deploy:rollback", "whenever:update_crontab"
17 17
 

5 notes on commit fba25d3

Lee Hambley

What's wrong with deploy:finalize_update ?

Javan Makhmali
Owner

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

Lee Hambley

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 Makhmali
Owner

Cool, works for me. Thanks for the explanation!

Corin Langosch
gucki commented on fba25d3 May 09, 2012

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

Please sign in to comment.
Something went wrong with that request. Please try again.