Skip to content

Instantly share code, notes, and snippets.

@av-ast
Last active December 28, 2015 18:09
Show Gist options
  • Save av-ast/7541417 to your computer and use it in GitHub Desktop.
Save av-ast/7541417 to your computer and use it in GitHub Desktop.
Release Erlang app
mkdir sample && cd sample/
rebar create-app appid=sample
mkdir rel && cd rel/
rebar create-node nodeid=sample
cd ..
Дальше создаём rebar.config (если его ещё нет):
cat rebar.config
{sub_dirs, ["rel"]}.
и немного полируем rel/reltool.config:
Изменяем строчку
{app, sample, [{mod_cond, app}, {incl_cond, include}]}
добавляем секцию lib_dir в конец:
{app, sample, [{mod_cond, app}, {incl_cond, include}, {lib_dir, ".."}]}
Теперь мы можем сделать:
rebar generate
./rel/sample/bin/sample console
Определенно стоит потвикать файл reltool.config, у меня например не запускается релиз если не добавить в секцию sys
{app, hipe, [{incl_cond, exclude}]},
{app, wx, [{incl_cond, exclude}]},
{app, webtool, [{incl_cond, exclude}]}
так же стоит почитать что вообще в этом файле можно писать например на lyse: http://learnyousomeerlang.com/release-is-the-word
Кстати, reltool предоставляет еще пару интересных плюшек, таких как шаблонизатор (см. overlay_vars), который поможет собрать релиз
в случае если у вас куча разных нод, напирмер вам нужно задать имя для каждой ноды по особому. Или подставить переменную в app.config
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment