Clarity on handling prod/dev config
yatesco opened this issue · 1 comments
So this looks great, but I have a few clarity questions:
pulling in external environment vars
Is prep-key
the right place to do this? Specifically for things like JDBC usernames/passwords etc.
separating prod and dev
In production Jetty isn't used as we deliver a WAR file, so at the moment we have a common.clj
which bootstraps the "main" system and is called from either a prod.clj
or a dev.clj
, both of which add environment specific things (e.g. jetty in dev).
Is this pattern still relevant, and I can see how dev
and prod
namespaces would include the relevant multimethod
implementations, but how do I implement "dev has jetty but prod doesn't"?
That's it for now - thanks!
prep-key
methods should ideally be pure. Adding in environment variables should be done directly after reading in the configuration. For example, both Duct and configuration management tools like Aero have reader tags for pulling in environment variables.
The same reasoning applies to separating production and development. Both Duct and Aero have inbuilt mechanisms for handling this, but you can also manually merge production-specific or development-specific keys into the configuration map depending on your environment.