Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Tips for authoring Heroku buildpacks

There's a lot of knowledge to be had about buildpacks. Start with reading the main docs:

Set your scripts to fail quickly & loudly

bash inherently swallows errors thrown by commands. Use the following at the top of your compile script:

#!/usr/bin/env bash

# Fail immediately on non-zero exit code.
set -e
# Fail immediately on non-zero exit code within a pipeline.
set -o pipefail
# Fail on undeclared variables.
set -u
# Debug, echo every command, uncomment for a lot of output
#set -x

DDD, deploy driven development

You'll need to commit and push to an app that uses a buildpack in order to see it run.

Use empty commits to keep pushing a repo without real changes:

git commit --allow-empty -m "🚢"
git push heroku master

Keep a separate terminal open tailing the app's logs:

heroku logs -t -a my-ddd-app
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.