buildpacks
Heroku for everything
Josep Jaume Rey (@josepjaume) - Twitter, GitHub
What happens when you push a Rack/Rails app to Heroku?
What's behind all that logic?
Heroku hides all that from us.
Until now!
Introducing heroku buildpacks
We now have all the flexibility of deploying Heroku apps right at the
build phase
It is in the beta program!
Heroku already had support for...
In the short existence of buildpacks, people has added support for:
A short introduction to the buildpack API
Formed by three basic pieces
- bin/detect
- bin/compile
- bin/release
They're all bash scripts!. That means that can be written
in any scripting language present on the system - Ruby, Perl, Bash, whatever
1) bin/detect
It takes BUILD_DIR as a single argument and should return an exit
code of 0 if the app present at BUILD_DIR can be serviced with this
buildpack.
2) bin/compile
Performs all the buildpack transformation. Takes BUILD_DIR
(which can be modified) and CACHE_DIR that will be reused between
deploys. Any output will be displayed to the user.
2) Interesting parts of bin/compile
Installing plugins
2) Interesting parts of bin/compile
Taken from io buildpack
3) bin/release
Takes BUILD_DIR and returns a YAML formatted hash with three keys:
- addons is a list of default addons to install
- config_vars is a hash of default environment vars to use. These will only be applied the first time the buildpack is used for each app.
- default_process_types is a YAML of default Procfile entries for this buildpack.
What can we do with buildpacks?
-
Better integration for our existing apps
remember the asset pipeline hell?
-
Additional actions on deployment
Synchronize assets or databases, cloning remote private repos?
-
Provide support for additional languages
NoScript, anyone? ;)
-
Just knowing what the heck is going on behind the scenes.
- Having a Codegram buildpack with all our default addons and standard procedures build-in
- World domination
-
Ideas ...?