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:

$ git clone https://github.com/tsloughter/minasan.git
$ cd minasan
$ heroku create --stack 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):

$ ./rebar update
$ ./rebar compile
$ ./relx -i true --dev-mode false release tar

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:

$ hk slug _rel/minasan/minasan-0.0.1.tar.gz
$ hk scale web=1
$ hk open

Your browser should now open to your new app.

A few things to note:

  • ‘./rebar 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.
Advertisements

2 thoughts on “Deploy Erlang Target System to Heroku

  1. Oh my goodness! Impressive article dude! Many thanks, However I am experiencing issues with your
    RSS. I don’t understand why I am unable to join it.
    Is there anybody getting identical RSS problems? Anybody who knows the solution will you kindly
    respond? Thanks!!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s