Code Monkey home page Code Monkey logo

heroku-buildpack-monorepo-with-shared-gems's Introduction

Heroku Monorepo Buildpack

Imagine you have a single code base, which has a few different applications within it... or at least the ability to run a few different applications. Or, maybe you're Google with your mono repo?

In any case, how do you manage this on Heroku? You don't. Heroku applications assume one repo to one application.

Enter the Monorepo buildpack, which is a copy of heroku-buildpack-multi-procfile except it moves the target path in to the root, rather than just the Procfile. This helps for ruby apps etc.

This buildpack was extended by Bus.com to add support for shared gems. The expected repository layout is:

.
+- app1
|   |
|   + Gemfile
|   + Gemfile.lock
|   + Procfile
|
+- app2
|   |
|   + Gemfile
|   + Gemfile.lock
|   + Procfile
|
+- shared
    |
    + gems
       |
       +- common
           |
           +- common.gemspec
           +- Gemfile

During the compile phase, APP_BASE is moved to /app, and shared/gems is moved within /app. Gemfile and Gemfile.lock are modified to move the shared/gems directory around, in case this app references the shared gems.

Usage

  1. Write a bunch of Procfiles apps and scatter them through out your code base.
  2. Create a bunch of Heroku apps.
  3. For each app, set APP_BASE=relative/path/to/app/root, and of course: heroku buildpacks:add -a <app> https://github.com/lstoll/heroku-buildpack-monorepo
  4. For each app, git push [email protected]:<app> master

Note: If you already have other buildpacks defined, you'll need to make sure that the heroku-buildpack-monorepo buildpack is defined first. You can do this by adding -i 1 to the heroku buildpacks:add command.

Authors

Andrew Gwozdziewycz [email protected] and Cyril David [email protected] and now Lincoln Stoll [email protected]

heroku-buildpack-monorepo-with-shared-gems's People

Contributors

apg avatar cyx avatar ecbrodie avatar edmorley avatar francois avatar javidjamae avatar lstoll avatar pdavid0 avatar sr avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

diogorosa boxt

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.