From 76fe80c01df965aa3cd4dade057a3b375756a163 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20B=C3=BChlmann?= Date: Wed, 23 Jul 2014 11:01:51 +0200 Subject: [PATCH 1/3] User proper syntax highlighting for sh and ruby snippets. --- README.md | 46 +++++++++++++++++++++++++++++++--------------- 1 file changed, 31 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index eb517f44..554252bc 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,9 @@ Bundler specific tasks for Capistrano v3: - * cap production bundler:install +```sh +$ cap production bundler:install +``` It also prefixes certain binaries to use `bundle exec`. @@ -10,22 +12,30 @@ It also prefixes certain binaries to use `bundle exec`. 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` @@ -38,29 +48,35 @@ set :bundle_bins, fetch(:bundle_bins, []).push %w(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 #This is only available for bundler 1.4+ +``` This would execute the following bundle command on all servers (actual paths depend on the real deploy directory): +```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. From fd195c64f123a555692bff0976a51bab03377f04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20B=C3=BChlmann?= Date: Wed, 23 Jul 2014 11:03:07 +0200 Subject: [PATCH 2/3] - Align command comments properly to README.md. - Add bundle_jobs default value to README.md. --- README.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 554252bc..9048663a 100644 --- a/README.md +++ b/README.md @@ -49,21 +49,21 @@ set :bundle_bins, fetch(:bundle_bins, []).push %w(my_new_binary) Configurable options: ```ruby -set :bundle_roles, :all # this is default +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 +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. ```ruby -set :bundle_jobs, 4 #This is only available for bundler 1.4+ +set :bundle_jobs, 4 # default: nil, only available for Bundler >= 1.4 ``` This would execute the following bundle command on all servers From 893e422e3acd82b02f5171d5fc8f9fbd32aa896e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20B=C3=BChlmann?= Date: Wed, 23 Jul 2014 11:05:03 +0200 Subject: [PATCH 3/3] Indent README snippet properly. --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 9048663a..5a783985 100644 --- a/README.md +++ b/README.md @@ -70,12 +70,12 @@ This would execute the following bundle command on all servers (actual paths depend on the real deploy directory): ```sh - bundle install \ - --binstubs /my_app/shared/bin \ - --gemfile /my_app/releases/20130623094732/MyGemfile \ - --path /my_app/shared/bundle \ - --without development test \ - --deployment --quiet +$ 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.