In this post these new tools will be used:
- rebar3 fork – my fork of rebar that has major refactoring and binary package support (Requires 17.x right now)
- hk – new cli client for Heroku
- hk slug plugin – plugin for hk that uploads the target system
- Heroku Cedar-14 – new Heroku Cedar on Ubuntu 14.04
- Heroku Slug API
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.