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

Remove bundler dependency #50

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@ This is a capistrano v3 plugin that integrates Unicorn tasks into capistrano dep

### Gotchas

- The `unicorn:start` task invokes unicorn as `bundle exec unicorn`.

- When running tasks not during a full deployment, you may need to run the `rvm:hook`:

`cap production rvm:hook unicorn:start`

- To use unicorn with bundler, you'll have to add the `capistrano-bundler` gem, and add the unicorn command to the bundle bins:

`set :bundle_bins, fetch(:bundle_bins, []).push('unicorn')`

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also you need hook rvm (if you use one):

set :rvm_map_bins, fetch(:rvm_map_bins, []).push('unicorn')

or if rbenv:

set :rbenv_map_bins, fetch(:rbenv_map_bins).to_a.concat(%w(unicorn))

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or rbenv for that matter, but people who will use those implementations, will probably know the implication of the usage.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no I didn't knew... I needed to read how sidekiq capistrano tasks was implemented.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

set :rbenv_map_bins, fetch(:rbenv_map_bins).to_a.concat(%w(unicorn))

is incorrect, or at least cumbersome.

this is more concise:

set :rbenv_map_bins, fetch(:rbenv_map_bins, []).push('unicorn')

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but it work's: set :rvm_map_bins, fetch(:rvm_map_bins).to_a.concat(%w(unicorn)) or set :rbenv_map_bins, fetch(:rbenv_map_bins).to_a.concat(%w(unicorn)) or for : chruby_map_bins or for bundle_bins

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or at least cumbersome


### Conventions

You can override the defaults by `set :unicorn_example, value` in the `config/deploy.rb` or `config/deploy/ENVIRONMENT.rb` capistrano deployment files.
Expand Down
2 changes: 1 addition & 1 deletion lib/capistrano3/tasks/unicorn.rake
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ namespace :unicorn do
info "unicorn is running..."
else
with rails_env: fetch(:rails_env) do
execute :bundle, "exec unicorn", "-c", fetch(:unicorn_config_path), "-E", fetch(:unicorn_rack_env), "-D", fetch(:unicorn_options)
execute :unicorn, "-c", fetch(:unicorn_config_path), "-E", fetch(:unicorn_rack_env), "-D", fetch(:unicorn_options)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 for this

end
end
end
Expand Down