Git Product home page Git Product logo

bundler's Introduction

Capistrano::Bundler

Bundler specific tasks for Capistrano v3:

$ 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.2'

And then execute:

$ bundle

Or install it yourself as:

$ gem install capistrano-bundler

Usage

Require in Capfile to use the default task:

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

By default, the plugin adds bundle exec prefix to common executables listed in bundle_bins option. This currently applies for gem, rake and rails.

You can add any custom executable to this list:

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') }            # default: nil
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 # default: nil, only available for Bundler >= 1.4

To generate binstubs on each deploy, set :bundle_binstubs path:

set :bundle_binstubs, -> { shared_path.join('bin') }

In the result 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

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

Environment Variables

The bundle_env_variables option can be used to specify any environment variables you want present when running the bundle command:

# This translates to NOKOGIRI_USE_SYSTEM_LIBRARIES=1 when executed
set :bundle_env_variables, { nokogiri_use_system_libraries: 1 }

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

bundler's People

Contributors

betesh avatar byroot avatar davekaro avatar daveslutzkin avatar hoshinotsuyoshi avatar juanibiapina avatar kirs avatar leehambley avatar mattbrictson avatar pjkelly avatar seenmyfate avatar seuros avatar spajus avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.