Allow InitializerConfig properties to be set from System Properties
Closed this issue · 2 comments
With the SDK, one does not have control over the contents of the openmrs-runtime.properties file that is created and used when a distribution is started for the first time.
This means that it is impossible to create and start an SDK server with the Initializer module and related configurations, while also controlling the loading configuration (eg. domains, exclusions, checksum handling, startup loading, etc).
A feature was added to the SDK some time back that allows for setting System Properties for a distribution. These properties are placed in openmrs-distro.properties and contain both prompts that are used in SDK server setup, and default values that are applied at SDK server setup, and result in System Properties being set and available to an SDK server.
The goal of this ticket is to modify InitializerConfig to lookup all runtime property values through a new method with the following logic:
- Check for a system property with the given property name. If found and not empty, return it.
- Otherwise, check for a runtime property with the given property name. Return it.
@Ruhanga there should be no adverse implication on instances not running the SDK (or otherwise). This just provides an additional option to set certain properties from SYSTEM properties initially, rather than for them to be present in runtime properties. @Ruhanga / @mks-d - thoughts on getting this approved and merged in please?