Skip to content

Allow Java system properties to override INI file #77

Description

@alexdma

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions