Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow Java system properties to override INI file #77

Open
alexdma opened this issue Nov 15, 2018 · 0 comments
Open

Allow Java system properties to override INI file #77

alexdma opened this issue Nov 15, 2018 · 0 comments

Comments

@alexdma
Copy link

alexdma commented Nov 15, 2018

Currently properties such as ds.serverName and ds.port must be defined in the properties file that is passed as system property basil.configurationFile. If these properties are passed on startup, the application does not seem to pick them up, see server initialization:

https://github.com/the-open-university/basil/blob/f6ab23a1cf322fd8aec7e38ee271048ecfbf1986/server/src/main/java/uk/ac/open/kmi/basil/server/BasilServerEnvironment.java#L15

In some instances, such as containerized environments like DC/OS, providing configuration files dynamically is not always handy. In such cases, setting environment variables is a preferable way. For example, if I set env variables DB_HOST and DB_PORT, then I could execute BASIl like this:

java -jar -Dbasil.configurationFile=basil.ini -Dds.serverName=${DB_HOST} -Dds.port=${DB_PORT} basil-server.jar -p 8080

where the ds.serverName and ds.port values would override those in basil.ini, if at all present.

It would be nice to have such support.

@alexdma alexdma changed the title Allow system properties to override INI file Allow Java system properties to override INI file Nov 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants