-
Notifications
You must be signed in to change notification settings - Fork 66
Allow users to set properties via OS environment variables #414
Comments
How about something a little more dense like:
|
How about using the same syntax used for passing properties from command line? |
I like the idea of always checking the environment variables of the same pseudo code would be: property[key] = env[key] || @properties[key] The only downside I see to this approach is that you could drive yourself |
Sounds interesting. I like the idea of prefixing with ml. We could also extend ml local info to provide more feedback, like where value came from, env, env.prop, build or defaults.. |
Could |
debug versus info, nice idea. Yes, I think debug should mention name of properties file (local.properties/build.properties), or Not sure what you mean by priority? |
Assuming |
I have actually implemented something for this. Unfortunately, ml.xxx is not a valid variable name, so I had to use ml_xxx instead. But everywhere a properties file is loaded using the load_properties function, values for defined properties are overridden by same-name env variable (ml.user -> ml_user). This way command-line overrides work strongest. And you don't need separate syntax for using env vars from within properties files or ml-config, just pre-declare them in one of the properties files..
The info command doesn't tell where values were coming from yet. We can always decide later to add that if people really need that.. |
Fixed in dev |
Provide a mechanism for letting users set properties to environment variables.
I created this as a workaround: https://github.com/marklogic/roxy/wiki/Using-Operating-System-Environment-Variables-in-properties
But I'd like to see it become an included feature for .properties. Perhaps something like:
maybe even (note the lack of quotes):
You could even allow other variables to get subbed-in:
The text was updated successfully, but these errors were encountered: