[erlang-questions] Dealing with different environment configurations?

Motiejus Jakštys desired.mta@REDACTED
Fri Mar 21 16:47:36 CET 2014


On Fri, Mar 21, 2014 at 4:23 PM, Roger Lipscombe <roger@REDACTED> wrote:
> We're currently packaging our Erlang node with relx. This generates a
> startup script that assumes releases/1/sys.config exists.
>
> Now, we have to deal with a couple of different environments: dev,
> test, staging, production. "production" is further divided into (e.g.)
> "production-us-east", "production-us-west", "production-eu", etc.
>
> How do people deal with the need to have different configuration files
> in different environments? Do you build a different release for each
> environment? Or do you replace the sys.config in each environment? If
> so, how?

sys.config can include other files: http://www.erlang.org/doc/man/config.html

We use 'priv/extra.config' for environment-specific configuration.

You might run into problems if you depend on these values from eunit,
here is a fix: https://github.com/rebar/rebar/pull/216. Scott Lystig
Fritchie is very conservative about merging it, but we have no
problems with the change for quite a while now.

Motiejus



More information about the erlang-questions mailing list