Giter Site home page Giter Site logo

appbundler's Introduction

Appbundler

Appbundler reads a Gemfile.lock and generates code with gem "some-dep", "= VERSION" statements to lock the app's dependencies to the versions selected by bundler. This code is used in binstubs for the application so that running (e.g.) chef-client on the command line activates the locked dependencies for chef before running the command.

This provides the following benefits:

  • The application loads faster because rubygems is not resolving dependency constraints at runtime.
  • The application runs with the same dependencies that it would if bundler was used, so we can test applications (that will be installed in an omnibus package) using the default bundler workflow.
  • There's no need to bundle exec or patch the bundler runtime into the app.
  • The app can load gems not included in the Gemfile/gemspec. Our use case for this is to load plugins (e.g., for knife and test kitchen).
  • A user can use rvm and still use the application (see below).
  • The application is protected from installation of incompatible dependencies.

Usage

Install via rubygems: gem install appbundler or clone this project and bundle install:

git clone https://github.com/opscode/appbundler.git
cd appbundler
bundle install

Clone whatever project you want to appbundle somewhere else, and bundle install it:

mkdir ~/oc
cd ~/oc
git clone https://github.com/opscode/chef.git
cd chef
bundle install

Create a bin directory where your bundled binstubs will live:

mkdir ~/appbundle-bin
# Add to your PATH if you like

Now you can app bundle your project (chef in our example):

bin/appbundler ~/oc/chef ~/appbundler-bin

Now you can run all of the app's executables with locked down deps:

~/appbunlder-bin/chef-client -v

RVM

The generated binstubs explicitly disable rvm, so the above won't work if you're using rvm. This is intentional, because our use case is for omnibus applications where rvm's environment variables can break the embedded application by making ruby look for gems in rvm's gem repo.

appbundler's People

Contributors

danielsdeleo avatar jaym 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.