Env vars in YML - only substituded with OS' ones

Hi guys.
Is it possible to – I realize it’s yaml kind of question but thought experts here should know – substitute params/vars with OS’ (bash) own, at build time?
Say…
host: /APPOW/log/${HOSTNAME}/discourse.test
I thought, expected this would work out-of-box but it did not, for me. Thanks.

Thanks. No, unless I’ve gone blind, temporarily - possible - does not cover my question. Does it?
I’m talking about OS’ env vars, shell variables which in YAML would resolve the their values – again, set in host’s shell (does not exist in .yml)

No.

You can set them at launch time, but not build time.

What are you trying to accomplish that you think replacing ENV in yaml at build time will accomplish?

These little tweaks are little saviours when scalling up, if only a bit.
That example above should be most telling – with no need to “fix” it in the yaml each time I build in different env / different host.
I sroogled and I see examples which claim that such simple substitution should work for YAML, but I can not get it to work.

I don’t believe that launcher will replace those ENV variables. It’s possible to build an image and then launch the same image multiple times with different domain names. You can

./launcher start-cmd app

To see what ENV is needed to launch.

To do it with a host that hasn’t bootstrapped, you’ll need to migrate the database and precompile assets.

2 Likes

That’d surely be very nice enhancement to future launcher versions, if it did.