[erlang-questions] Erlang application packaging

Ali Sabil <>
Thu Sep 20 17:49:21 CEST 2012


Ok, sorry :)

Basically in Erlang, the concept of release is pretty close to the
concept of Linux distributions, a release allows you to package the
erlang runtime and a set of applications together into a distribution.
The easiest way to generate releases is probably by using rebar. Here
is a small quickstart on how to generate a release using rebar:

  mkdir -p product && cd product
  wget http://cloud.github.com/downloads/basho/rebar/rebar && chmod u+x rebar
  mkdir rel && cd rel
  ../rebar create-node nodeid=product
  # edit the reltool.config file to remove the non-existing product
application from the release
  # this is done by removing the product atom right after the sasl
atom and the comma separating them
  # as well as {app, product, [{incl_cond, include}]} and the comma before it
  # this is to have a running release
  ../rebar generate
  ./product/bin/product console  # this will start a node based on your release

The applications you want to include are generally placed in apps/
and/or deps/ at the root and you just need to edit the reltool.config
file and add
  {lib_dirs, ["../apps", "../deps"]}
inside the sys section

That said you might not really need to use a release to package your
application, if you have an erlang runtime available on the target
machine you could either turn your application into an escript (the
escriptize command in rebar) or use a shell script.

Hope this helps,
Ali


On Thu, Sep 20, 2012 at 4:33 PM, Jean Parpaillon
<> wrote:
> Hi Ali
> Thank you for your help.
> I've begun erlang with this tutorial but I have to admit I am still
> confused about the right tool to use. Just in learnyou..., reltool and
> systools are presented.
> Let's read again this chapter :)
>
> Regards,
> Jean
>
> Le jeudi 20 septembre 2012 à 16:11 +0200, Ali Sabil a écrit :
>> Hi Jean,
>>
>> I don't know if you have come across this:
>> http://learnyousomeerlang.com/release-is-the-word#am-i-an-executable-yet
>> but it might be helpful?
>>
>> Best,
>> Ali
>>
>> On Thu, Sep 20, 2012 at 3:52 PM, Jean Parpaillon
>> <> wrote:
>> > Hi all,
>> > I'm Jean Parpaillon, new erlang enthusiast and (soon) programmer. On 7
>> > past years, I've workedon distributed systems, specially in HPC and
>> > cloud computing. I'm trying to develop an XMPP agent for system
>> > management, written in Erlang. This is the introduction, now the
>> > question :)
>> > What is your preferred packaging/deployment system for erlang ? I have a
>> > code running, from erlang shell, and want it to become a real world
>> > application the user can install from an archive and launch from its
>> > shell, eventually with some parameters.
>> >
>> > I've read about systools, and how to generated .app, .appup, .rel, .boot
>> > and so on. This looks fine but a lot to do by hand. When it comes to
>> > update a file, and release the whole stuff, one have to modify plenty of
>> > others. Or am I wrong ?
>> > I've looked to existing applications or 'helloworld's: some of them
>> > using autotools (ejabberd, ...), a lot of others using rebar, sometime a
>> > little a bit of both, iirc.
>> > rebar has a lot of magic, which makes debugging hard.
>> > autotools is not well designed for erlang, but putting some existing m4
>> > files here and there seems to fit. At least, I know autotools well. I
>> > know how can I generate .app, .rel and so on with autotools, but I don't
>> > know what to put in it :/
>> > At the end, for launching the application, I've seen many projects not
>> > using .boot files, but a shell script with tons of arguments to erl...
>> >
>> > I'm a little bit confused :( Any help ?
>> >
>> > Best regards,
>> > --
>> > Jean Parpaillon
>> > Open Source Consultant
>> > Phone: +33 6 30 10 92 86
>> > im: 
>> > skype: jean.parpaillon
>> > linkedin: http://www.linkedin.com/in/jeanparpaillon/en
>> >
>> >
>> > _______________________________________________
>> > erlang-questions mailing list
>> > 
>> > http://erlang.org/mailman/listinfo/erlang-questions
>> >
>
> --
> Jean Parpaillon
> Open Source Consultant
> Phone: +33 6 30 10 92 86
> im: 
> skype: jean.parpaillon
> linkedin: http://www.linkedin.com/in/jeanparpaillon/en
>



More information about the erlang-questions mailing list