start multiple MyApp with custom args

bellow is my mix.exs:

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.

So what if I start multiple in supervisor, like this:

args = [["lib/demo_pipeline1/app_config.exs"],
        ["lib/demo_pipeline2/app_config.exs"]] 
children = Enum.map(args, &supervisor(App.Supervisor, &1))
opts = [strategy: :one_for_one, name: __MODULE__]
Supervisor.start_link(children, opts)