Skip to content

Commit

Permalink
Merge pull request capistrano#51 from tbuehlmann/README-love
Browse files Browse the repository at this point in the history
Readme love
  • Loading branch information
kirs committed Aug 29, 2014
2 parents b6e609d + 893e422 commit 010c47f
Showing 1 changed file with 37 additions and 21 deletions.
58 changes: 37 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,40 @@

Bundler specific tasks for Capistrano v3:

* cap production bundler:install
```sh
$ cap production bundler:install
```

It also prefixes certain binaries to use `bundle exec`.

## Installation

Add these lines to your application's Gemfile:

gem 'capistrano', '~> 3.1'
gem 'capistrano-bundler', '~> 1.1.3'
```ruby
gem 'capistrano', '~> 3.1'
gem 'capistrano-bundler', '~> 1.1.2'
```

And then execute:

$ bundle
```sh
$ bundle
```

Or install it yourself as:

$ gem install capistrano-bundler
```sh
$ gem install capistrano-bundler
```

## Usage

Require in `Capfile` to use the default task:

require 'capistrano/bundler'
```ruby
require 'capistrano/bundler'
```

The task will run before `deploy:updated` as part of Capistrano's default deploy, or can be run in isolation with `cap production bundler:install`

Expand All @@ -38,29 +48,35 @@ set :bundle_bins, fetch(:bundle_bins, []).push 'my_new_binary'

Configurable options:

set :bundle_roles, :all # this is default
set :bundle_servers, -> { release_roles(fetch(:bundle_roles)) } # this is default
set :bundle_binstubs, -> { shared_path.join('bin') } # this is default
set :bundle_gemfile, -> { release_path.join('MyGemfile') } # default: nil
set :bundle_path, -> { shared_path.join('bundle') } # this is default
set :bundle_without, %w{development test}.join(' ') # this is default
set :bundle_flags, '--deployment --quiet' # this is default
set :bundle_env_variables, {} # this is default
```ruby
set :bundle_roles, :all # this is default
set :bundle_servers, -> { release_roles(fetch(:bundle_roles)) } # this is default
set :bundle_binstubs, -> { shared_path.join('bin') } # this is default
set :bundle_gemfile, -> { release_path.join('MyGemfile') } # default: nil
set :bundle_path, -> { shared_path.join('bundle') } # this is default
set :bundle_without, %w{development test}.join(' ') # this is default
set :bundle_flags, '--deployment --quiet' # this is default
set :bundle_env_variables, {} # this is default
```

You can parallelize the installation of gems with bundler's jobs feature.
Choose a number less or equal than the number of cores your server.

set :bundle_jobs, 4 #This is only available for bundler 1.4+
```ruby
set :bundle_jobs, 4 # default: nil, only available for Bundler >= 1.4
```

This would execute the following bundle command on all servers
(actual paths depend on the real deploy directory):

bundle install \
--binstubs /my_app/shared/bin \
--gemfile /my_app/releases/20130623094732/MyGemfile \
--path /my_app/shared/bundle \
--without development test \
--deployment --quiet
```sh
$ bundle install \
--binstubs /my_app/shared/bin \
--gemfile /my_app/releases/20130623094732/MyGemfile \
--path /my_app/shared/bundle \
--without development test \
--deployment --quiet
```

If any option is set to `nil` it will be excluded from the final bundle command.

Expand Down

0 comments on commit 010c47f

Please sign in to comment.