Deploy Erlang Target System to Heroku

In this post these new tools will be used:

First, clone minasan and create the Heroku application on Cedar-14:

Now that Heroku has the cedar-14 stack if you are also running a recent Linux distro you can upload the target system created by relx directly to your app, before now we would have to build it on Heroku or in a system with an older glibc to work on Heroku’s Ubuntu 10.04.

Since minasan is using binary packages and a fork of rebar be sure to use the rebar included in the repo, same goes for _relx _so that including the Procfile in the tarball works. The first step will be to update the package index for rebar, then compiling and building the release tarball (with erts included and dev-mode off so the Erlang runtime is included):

Using the new Slug API endpoint through hk slug the tarball can be pushed directly as a slug to your app and then scale up the web process to at least 1:

Your browser should now open to your new app.

A few things to note:

  • './rebar3 pkgs' will show you a list of available packages to use in rebar deps
  • Currently ‘hk slug’ only support sending a tarball that does not yet have the structure of a slug. So it is unpacked and repacked. I plan to support directories and properly formatted tarballs.