master 82e175c304f9 cached
4 files
2.0 KB
685 tokens
1 requests
Download .txt
Repository: lstoll/heroku-buildpack-monorepo
Branch: master
Commit: 82e175c304f9
Files: 4
Total size: 2.0 KB

Directory structure:
gitextract_s4da254e/

├── README.md
└── bin/
    ├── compile
    ├── detect
    └── release

================================================
FILE CONTENTS
================================================

================================================
FILE: README.md
================================================
# 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](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.

# 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 git@heroku.com:<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 <apg@heroku.com> and Cyril David <cyx@heroku.com> and now Lincoln Stoll <lstoll@heroku.com>


================================================
FILE: bin/compile
================================================
#!/usr/bin/env bash

# Ensure wildcards in globs match dotfiles too.
shopt -s dotglob

indent() {
    sed -u 's/^/      /'
}

BUILD_DIR="$1"
CACHE_DIR="$2"
ENV_DIR="$3"
STAGE="$(mktemp -d)"

if [ ! -f "${ENV_DIR}/APP_BASE" ]; then
    echo "APP_BASE was not set. Aborting" | indent
    exit 1
fi
APP_BASE="$(cat "${ENV_DIR}/APP_BASE")"

(
    mv "${BUILD_DIR}/${APP_BASE}" "${STAGE}" &&
    rm -rf "${BUILD_DIR}"/* &&
    mv "${STAGE}/$(basename "$APP_BASE")"/* "${BUILD_DIR}"
)

if [ $? -ne 0 ]; then
    echo "FAILED to copy directory into place" | indent
    exit 1
fi

echo "Copied ${APP_BASE} to root of app successfully" | indent



================================================
FILE: bin/detect
================================================
#!/usr/bin/env bash

echo "Monorepo"
exit 0


================================================
FILE: bin/release
================================================
#!/usr/bin/env bash

echo "--- {}"
exit 0
Download .txt
gitextract_s4da254e/

├── README.md
└── bin/
    ├── compile
    ├── detect
    └── release
Condensed preview — 4 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (2K chars).
[
  {
    "path": "README.md",
    "chars": 1275,
    "preview": "# Heroku Monorepo Buildpack\n\nImagine you have a single code base, which has a few different applications within it... or"
  },
  {
    "path": "bin/compile",
    "chars": 637,
    "preview": "#!/usr/bin/env bash\n\n# Ensure wildcards in globs match dotfiles too.\nshopt -s dotglob\n\nindent() {\n    sed -u 's/^/      "
  },
  {
    "path": "bin/detect",
    "chars": 44,
    "preview": "#!/usr/bin/env bash\n\necho \"Monorepo\"\nexit 0\n"
  },
  {
    "path": "bin/release",
    "chars": 42,
    "preview": "#!/usr/bin/env bash\n\necho \"--- {}\"\nexit 0\n"
  }
]

About this extraction

This page contains the full source code of the lstoll/heroku-buildpack-monorepo GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 4 files (2.0 KB), approximately 685 tokens. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!