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

Prepare command with bundle exec using SSH prefixes #16

Merged
merged 4 commits into from
Nov 23, 2013
Merged
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
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ Configurable options, shown here with defaults:
set :bundle_without, %w{development test}.join(' ')
set :bundle_binstubs, -> { shared_path.join('bin') }
set :bundle_roles, :all
set :bundle_bins, %w(gem rake ruby)

By default, the plugin adds `bundle exec` prefix to common executables listed in `bundle_bins` option. You can add any custom executable to this list:

```ruby
set :bundle_bins, fetch(:bundle_bins).push %w(my_new_binary)
```

## Contributing

Expand Down
1 change: 1 addition & 0 deletions capistrano-bundler.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Gem::Specification.new do |spec|
spec.require_paths = ['lib']

spec.add_dependency 'capistrano', '>= 3.0.0.pre'
spec.add_dependency 'sshkit', '>= 1.2.0'

spec.add_development_dependency 'bundler', '~> 1.3'
spec.add_development_dependency 'rake'
Expand Down
11 changes: 11 additions & 0 deletions lib/capistrano/tasks/bundler.cap
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,19 @@ namespace :bundler do
end
end

task :map_bins do
fetch(:bundle_bins).each do |command|
SSHKit.config.command_map.prefix[command.to_sym].push("bundle exec")
end
end

before 'deploy:updated', 'bundler:install'
end

Capistrano::DSL.stages.each do |stage|
after stage, 'bundler:map_bins'
end

namespace :load do
task :defaults do
set :bundle_gemfile, -> { release_path.join('Gemfile') }
Expand All @@ -37,5 +47,6 @@ namespace :load do
set :bundle_without, %w{development test}.join(' ')
set :bundle_binstubs, -> { shared_path.join('bin') }
set :bundle_roles, :all
set :bundle_bins, %w{gem rake ruby}
end
end