Permalink
Browse files

Use deploy:finalize_update instead deploy:restart

  • Loading branch information...
1 parent 0252679 commit 7ae1009c31deb03c5db4a68f5fc99ea099ce5655 @sparrovv sparrovv committed May 16, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/whenever/capistrano.rb
@@ -5,7 +5,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.
- before "deploy:restart", "whenever:update_crontab"
+ before "deploy:finalize_update", "whenever:update_crontab"
# If anything goes wrong, undo.
after "deploy:rollback", "whenever:update_crontab"

3 comments on commit 7ae1009

in the current capistrano 2.12.0 the finalize_update task is called from within the update_code task (pasted below) - Since the crontab is cleared after update_code, doing the update before finalize_update has the outcome of updating the crontab and then clearing it after its been updated which I assume is not the intended behavior

task :update_code, :except => { :no_release => true } do
on_rollback { run "rm -rf #{release_path}; true" }
strategy.deploy!
finalize_update
end

FYI, this change breaks capistrano if the deployer is using bundler <= 1.1.4, which was release in May 2012.

If using older versions of Bunlder (without bundler 5d518bec98) the whenever capistrano tasks fire before the bundler cap tasks, causing errors.

In my case it was just time to update Bundler 😄

The same happens for those using the brightbox gem, i.e. whenever fires before bundling and results in things like "Could not find [gem] in any of the sources"

Please sign in to comment.