All Projects → capistrano → Bundler

capistrano / Bundler

Licence: mit
Bundler support for Capistrano 3.x

Programming Languages

ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to Bundler

Pulsar
Manage your Capistrano deployments with ease
Stars: ✭ 129 (-40.28%)
Mutual labels:  capistrano
Webpack.js.org
Repository for webpack documentation and more!
Stars: ✭ 2,049 (+848.61%)
Mutual labels:  bundler
Bundler
🎁 Android Intent & Bundle extensions that insert and retrieve values elegantly.
Stars: ✭ 195 (-9.72%)
Mutual labels:  bundler
Wean
🍀 小程序构建工具 ♂ 重新实现小程序标准 ♀ 小程序 => web
Stars: ✭ 125 (-42.13%)
Mutual labels:  bundler
Velcro
A set of tools and libraries for stitching together modules and code in highly dynamic browser environments
Stars: ✭ 159 (-26.39%)
Mutual labels:  bundler
Deploy
Ansible role to deploy scripting applications like PHP, Python, Ruby, etc. in a capistrano style
Stars: ✭ 2,141 (+891.2%)
Mutual labels:  capistrano
Bundleup
A friendlier CLI for Bundler’s `update` and `outdated` commands.
Stars: ✭ 111 (-48.61%)
Mutual labels:  bundler
Gem updater
Update gems in your Gemfile and fetch their changelogs
Stars: ✭ 206 (-4.63%)
Mutual labels:  bundler
Capistrano Rails Console
Capistrano plugin which adds a remote rails console and dbconsole
Stars: ✭ 166 (-23.15%)
Mutual labels:  capistrano
Rbenv
Idiomatic rbenv support for Capistrano 3.x
Stars: ✭ 194 (-10.19%)
Mutual labels:  capistrano
Enb
Tool for building web projects, BEM bundler.
Stars: ✭ 136 (-37.04%)
Mutual labels:  bundler
Capistrano
Remote multi-server automation tool
Stars: ✭ 12,035 (+5471.76%)
Mutual labels:  capistrano
Cape
Dynamically generates Capistrano recipes for Rake tasks
Stars: ✭ 178 (-17.59%)
Mutual labels:  capistrano
Instapack
All-in-one TypeScript and Sass compiler for web applications! 📦 🚀
Stars: ✭ 131 (-39.35%)
Mutual labels:  bundler
Fastpack
Pack JS code fast & easy
Stars: ✭ 2,278 (+954.63%)
Mutual labels:  bundler
Capistrano Mb
[unmaintained] Capistrano tasks for deploying Rails from scratch to Ubuntu 16.04 and 18.04
Stars: ✭ 117 (-45.83%)
Mutual labels:  capistrano
Carton
📦 Watcher, bundler, and test runner for your SwiftWasm apps
Stars: ✭ 171 (-20.83%)
Mutual labels:  bundler
Roundsman
Combines Capistrano with Chef Solo
Stars: ✭ 208 (-3.7%)
Mutual labels:  capistrano
Browserify
browser-side require() the node.js way
Stars: ✭ 13,929 (+6348.61%)
Mutual labels:  bundler
Procsd
Manage your application processes in production hassle-free like Heroku CLI with Procfile and Systemd
Stars: ✭ 181 (-16.2%)
Mutual labels:  capistrano

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 [Recommended]:

gem 'capistrano', '~> 3.6'
gem 'capistrano-bundler', '~> 2.0'

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.

In order for Bundler to work efficiently on the server, its project configuration directory (<release_path>/.bundle/) should be persistent across releases. You need to add it to the linked_dirs Capistrano variable:

Capistrano 3.5+:

# config/deploy.rb

append :linked_dirs, '.bundle'

Capistrano < 3.5:

# config/deploy.rb

set :linked_dirs, fetch(:linked_dirs, []) << '.bundle'

It will still work fine with non-persistent configuration directory, but then it will have to re-resolve all gems on each deploy.

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_config, { deployment: true }                        # 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 it to nil to use bundler's default path
set :bundle_without, %w{development test}.join(':')             # this is default
set :bundle_flags, '--quiet'                                    # this is default
set :bundle_env_variables, {}                                   # this is default
set :bundle_clean_options, ""                                   # this is default. Use "--dry-run" if you just want to know what gems would be deleted, without actually deleting them
set :bundle_check_before_install, true                          # default: true. Set this to false to bypass running `bundle check` before executing `bundle install`

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, 8 # default: 4, 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 commands on all servers (actual paths depend on the real deploy directory):

$ bundle config --local deployment true
$ bundle config --local gemfile /my_app/releases/20130623094732/MyGemfile
$ bundle config --local path /my_app/shared/bundle
$ bundle config --local without "development test"
$ bundle install --quiet --binstubs /my_app/shared/bin

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

If you want to clean up gems after a successful deploy, add after 'deploy:published', 'bundler:clean' to config/deploy.rb.

Downsides to cleaning:

  • If a rollback requires rebuilding a Gem with a large compiled binary component, such as Nokogiri, the rollback will take a while.
  • In rare cases, if a gem that was used in the previously deployed version was yanked, rollback would entirely fail.

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
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].