Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update crontab later in capistrano lifecycle #324

Closed
wants to merge 1 commit into from

Conversation

niklas
Copy link
Contributor

@niklas niklas commented Mar 18, 2013

with capistrano 2.13.5, before 'finalize_update' runs before bundler, leading to "command not found: whenever"

with capistrano 2.13.5, before 'finalize_update' runs before bundler, leading to "command not found: whenever"
@javan
Copy link
Owner

javan commented Mar 19, 2013

Just be sure to require Whenever after Bundler and it should work fine.

@javan javan closed this Mar 19, 2013
@schorsch
Copy link

+1 had the same prob with gems not beeing checked out. worked around it by manually including recipies and than using my hooks:

# manual to influence later execution time
#require 'whenever/capistrano'
require 'whenever/capistrano/recipes'

after "deploy:finalize_update",  "whenever:update_crontab"
after "deploy:rollback", "whenever:update_crontab" 

@andyh
Copy link

andyh commented Mar 26, 2013

@schorsch thanks for that info. I had the same problem with an app that's using Brightbox's gem for deploying to brightbox servers - it does it's bundle tasks as an after callback to deploy:finalize_update so after adding whenever the deployments weren't successful because it was trying to run the whenever tasks before installing the gem.

@javan Is it possible to make whenever more flexible in when the capistrano callbacks are run? Or are you happy that this workaround is what should be used in cases like this?

@javan
Copy link
Owner

javan commented Mar 26, 2013

@schorsch approach is an example of the intended flexibility. It's why the recipes are in a separate file.

If you're using the latest version of Bundler and you require Whenever after Bundler, no changes are needed.

@andyh
Copy link

andyh commented Mar 26, 2013

@javan cool. I just wanted to check since it wasn't documented specifically anywhere. In my case with the brightbox gem even though we are using the latest version of bundler, it doesn't work since they're using their own mechanism for running bundle install, etc. I will add @schorsch's workaround to the troubleshotting page on the wiki so that hopefully you won't get too hassled by repeat issues :)

@brucepom
Copy link

brucepom commented Apr 7, 2013

@javan thanks for the tip about updating bundler. If anyone else runs into this.
$ gem update bundler
fixed it for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants