[
  {
    "path": "README.md",
    "content": "# Heroku Monorepo Buildpack\n\nImagine 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?\n\nIn any case, how do you manage this on Heroku? You don't. Heroku applications assume one repo to one application.\n\nEnter the Monorepo buildpack, which is a copy of [heroku-buildpack-multi-procfile](https://github.com/heroku/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.\n\n# Usage\n\n1. Write a bunch of ~~Procfiles~~ apps and scatter them through out your code base.\n2. Create a bunch of Heroku apps.\n3. For each app, set `APP_BASE=relative/path/to/app/root`, and of course:\n   `heroku buildpacks:add -a <app> https://github.com/lstoll/heroku-buildpack-monorepo`\n4. For each app, `git push git@heroku.com:<app> master`\n\nNote: 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.\n\n# Authors\n\nAndrew Gwozdziewycz <apg@heroku.com> and Cyril David <cyx@heroku.com> and now Lincoln Stoll <lstoll@heroku.com>\n"
  },
  {
    "path": "bin/compile",
    "content": "#!/usr/bin/env bash\n\n# Ensure wildcards in globs match dotfiles too.\nshopt -s dotglob\n\nindent() {\n    sed -u 's/^/      /'\n}\n\nBUILD_DIR=\"$1\"\nCACHE_DIR=\"$2\"\nENV_DIR=\"$3\"\nSTAGE=\"$(mktemp -d)\"\n\nif [ ! -f \"${ENV_DIR}/APP_BASE\" ]; then\n    echo \"APP_BASE was not set. Aborting\" | indent\n    exit 1\nfi\nAPP_BASE=\"$(cat \"${ENV_DIR}/APP_BASE\")\"\n\n(\n    mv \"${BUILD_DIR}/${APP_BASE}\" \"${STAGE}\" &&\n    rm -rf \"${BUILD_DIR}\"/* &&\n    mv \"${STAGE}/$(basename \"$APP_BASE\")\"/* \"${BUILD_DIR}\"\n)\n\nif [ $? -ne 0 ]; then\n    echo \"FAILED to copy directory into place\" | indent\n    exit 1\nfi\n\necho \"Copied ${APP_BASE} to root of app successfully\" | indent\n\n"
  },
  {
    "path": "bin/detect",
    "content": "#!/usr/bin/env bash\n\necho \"Monorepo\"\nexit 0\n"
  },
  {
    "path": "bin/release",
    "content": "#!/usr/bin/env bash\n\necho \"--- {}\"\nexit 0\n"
  }
]