Deployment with meteor build: How to provide settings.json?

By the way, that solution @victor brought up ( I think from meteor-base having the same issue? ) … has bloomed over here.

Once you find yourself pre-processing JSON in a bash script, which does not sound exciting, it becomes a whole new possible world in multi-entrypoint environments.

One is then free to go full-:nerd_face: as follows:

If you pair jq with that solution, you can then load multiple configuration files over each other. Or remove certain portions of what would previously be one big glob shared everywhere. One can only give what the code needs, to each application if you have more than just client and server applications in one environment.

What really “bakes your noodle later on” is how to get jq to deep-merge objects. And also: why were we not doing this before? Why not force JSON in through an environment variable? Why did I take this long to not hate that convention so deeply? I remember hating with a passion not to be able to pull JSON within the process versus have a layer which decides and assembles the configuration which itself might change agent behavior and summon the right one!

Remember, this is all still in a bash script before your deployment boots up in a container :rocket:

Only change needed then: if using an alpine build you need apk to pull in jq and if using a debian / ubuntu build like most node images, then you need apt-get to include jq … but does not hurt image size very much.

Of course it is possible to just render settings from multiple scripts into one and still pass one, but maintaining a settings “build” while also maintaining everything else feels more insane. And being able to swap configurations on-the-run without intervention seems awesome to have the freedom open to do still.

This “annoying problem” of being forced into using environment variables and passing in JSON became something very helpful actually, and pretty cool.

jq seems pretty well setup team-wise … might even get a deep-merge command from their ninjas :rofl: