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

Use current_path as a fallback for whenever_path #729

Merged
merged 2 commits into from
Nov 29, 2017

Conversation

ta1kt0me
Copy link
Contributor

There is a problem that nil is set to whenever_path in executing the whenever task directly via Capistrano. I think calling release_path is useful in the case because it's enough to set deploy_toonly.

@benlangfeld
Copy link
Collaborator

I'm not sure I understand what this does. Could you explain more? Including a changelog entry would also allow me to merge this more easily.

@ta1kt0me
Copy link
Contributor Author

Let me explain little bit more, here is what happened when I tried to execute whenever's task independently integrated with Capistrano.
I had set :deploy_to, while I had not set :release_path and whenever_path in deploy.rb. Then executing cap whenver:clear_crontab or cap whenever:update_crontab failed as follows:

00:00 whenever:clear_crontab
      01 bundle exec whenever --clear-crontab wheneverapp_local
      01 Could not locate Gemfile or .bundle/ directory
(Backtrace restricted to imported tasks)
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing as vagrant@127.0.0.1: bundle exit status: 10
bundle stdout: Could not locate Gemfile or .bundle/ directory
bundle stderr: Nothing written


Caused by:
SSHKit::Command::Failed: bundle exit status: 10
bundle stdout: Could not locate Gemfile or .bundle/ directory
bundle stderr: Nothing written

On the other hand, Executing cap deploy doesn't fail because :release_path is set by Capistrano::DSL::Paths#set_release_path method, which is not called during any of whenever's jobs.
Althogh I can avoid such error by setting :release_path or :whenever_paht manually, if we use Capistrano::DSL::Paths#release_path in :whenever_paht 's proc, we don't even need to do so.

I'll write changelog later.

@ta1kt0me ta1kt0me force-pushed the use_current_path_as_a_fallback branch from 2456a4b to 5d4ae39 Compare November 28, 2017 12:25
@ta1kt0me ta1kt0me force-pushed the use_current_path_as_a_fallback branch from 5d4ae39 to cdd22a5 Compare November 28, 2017 12:27
@ta1kt0me
Copy link
Contributor Author

I updated changelog.

@benlangfeld benlangfeld merged commit b656747 into javan:master Nov 29, 2017
@ta1kt0me ta1kt0me deleted the use_current_path_as_a_fallback branch November 30, 2017 01:33
@akicho8
Copy link

akicho8 commented Dec 16, 2017

I was in trouble with the same phenomenon. Thank you for fixing. 👍

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.

3 participants