Buildpacks


What are Buildpacks?

Buildpacks are the adapter between application code and the Heroku platform, turning pushed code into "slugs" suitable for deployment. A buildpack targets a specific runtime or build tool.

Creating a Buildpack

If you want to deploy an app that's not yet supported by any of the existing buildpacks, you can create your own. Buildpacks at their core consist of two scripts, bin/detect for determining whether they apply to a given app, and bin/compile for generating the actual slug. See the devcenter for the details of how those scripts work.

Once you've written your buildpack, you can publish it here using the heroku-buildkits plugin:

$ heroku plugins:install https://github.com/heroku/heroku-buildkits
$ cd /path/to/my/buildpack
$ heroku buildkits:publish me/my-buildpack

Buildpacks are scoped to an organization, which is specified by the part preceding the slash; in the example above "me" is the organization and "my-buildpack" is the buildpack name.

The plugin allows you to list revisions and roll back using the buildkits:revisions and buildkits:rollback commands respectively.