3
votes

I have this on my Makefile:

CONFIG ?= "apps/${NODE}/priv/app.config"
RUN := erl -pa apps/${NODE}/ebin -pa deps/*/ebin -smp enable -s lager -boot start_sasl -config ${CONFIG} ${ERL_ARGS}

How do I pass the -config apps/appname/priv/app.config and -s lager options while using rebar generate

I suspect it goes somewhere in reltool.config but not sure where ?

Also, to clarify, 'rebar generate' works fine but when launching the generated version from the bin folder the error has to do with the config not being loaded.

1
Including the option at runtime like this: ./bin/appname console -config lib/appname-0.2/priv/app.config works fine it seems. This is also okay, but am I missing something that would include the option as part of the release ? Overlay variables seem like something to look into as wellantipatreal
After yet more digging I can see how the final config is built. erlang.org/doc/man/config.html It's basically a merge of app.config in my 'priv' folder and sys.config in $ROOT/releases/Vsn The question is; how does sys.config end up there from my source files ? Can I put a sys.config somewhere in my source and it will be picked up ?antipatreal

1 Answers

0
votes

These flags normally go in the vm.args file.

It can be generated by running rebar create-node, the full tutorial for rebar is here: https://github.com/rebar/rebar/wiki/Release-handling