Description
Context:
Currently, I always have to hardcode the values for the Optimize configuration. However, sometimes the values are configured in evironment variables to set those configurations once and then they can be reused everywhere.
AT:
- configuration values which are set as environment variables are automatically being resolved, when the respective environment variables exist, otherwise startup fails indicating which variable is missing
- the following types of variables can be resolved/are supported as a config property value using a placeholder:
- OS environment variables
- java system properties
- the order to resolve the value of a configuration property is:
- java system properties, e.g. -DAUTH_TOKEN_LIFEMIN=5 with the config.yaml containing {{ auth.token.lifeMin: ${AUTH_TOKEN_LIFEMIN} }}
- OS Environment Variables, e.g. AUTH_TOKEN_LIFEMIN=5 with the config.yaml containing {{ auth.token.lifeMin: ${AUTH_TOKEN_LIFEMIN} }}
- yaml property values, e.g. auth.token.lifeMin:5
- the placeholder format used in property values is ${<NAME>}, e.g. ${AUTH_TOKEN_LIFEMIN}
- this behavior is documented in the technical guide of Optimize