Search code examples
environment-variablesbuild.gradlesymmetricds

Reading environment variables in SymmetricDS engine properties


I'm using the Gradle Application plugin to create a zip distribution of SymmetricDS. It would be nice to have a simple way of switching between environments (test, staging, production, whatever).

The SymemtricDS User Guide says

SymmetricDS will automatically create a node for each Node Properties
File configured in the engines directory

So, it will probably not be possible to define engines for all environments and choose which one to start, without doing this manually.

A better way would probably be to have SymmetricDS read some environment variables and use these to define e.g. db.url in the engine files. This way the same config could be used for all environments. Is this possible?


Solution

  • There have been several requests for something like this. I noticed someone setting up docker images also would benefit from being able to specify dynamic properties. I'm adding the ability to do token replacement with environment variable or system properties in 3.8.12.

    Here is the issue to track it: https://www.symmetricds.org/issues/view.php?id=2945