def application do
[
mod: {MyApp, ["lib/pipeline_config/demo.exs"]},
extra_applications: [:logger]
]
end
How could I start multiple MyApp with custom configs at the same time?
Eg:
{MyApp, [“lib/pipeline_config/demo_1.exs”]}
{MyApp, [“lib/pipeline_config/demo_2.exs”]}
{MyApp, [“lib/pipeline_config/demo_3.exs”]}
You cannot do it in the Mixfile. The Mixfile is read at compile-time only, so in runtime the argument would be fixed. The first entrypoint for an OTP application is the start/2 callback; there you could get information from the environment (System.get_env) for your separate applications. A normal OTP application does not have the “normal” notion of commandline arguments like a regular unix program does.
However, if you’re looking into creating a program that accepts commandline arguments, you could look at the escript functionality.