Support additional property sources during configuration
See original GitHub issueDuring a brainstorm for removing the explicit runner found in https://github.com/moditect/layrry-examples/tree/master/modular-tiles I thought it might be a good idea to provide the Layrry launcher with an addition source of properties that can be used for placeholder substitution, something akin to
`java -jar layrry-launcher.jar --layers-config layers.yml --properties layrry.properties`
The launcher would then read the properties file and place all properties into the Mustache scope, allowing placeholder substitutions. This could turn a somewhat static Layers config file into a “self updatable” config source, as [groupId, artifactId, version] could be provided by external properties. No need to provide a similar layers.yml
file to update a version (say from groovy-json:3.0.5
to groovy-json:3.0.6
) but also may handle artifact relocation.
Example:
Groovy 3 is currently published with groupId = org.codehaus.groovy
.
Groovy 4 will change to groupId = org.apache.groovy
.
A layers file that requires Groovy could declare a module definition as
"{{groovy.groupId}}:groovy-json:{{groovy.version}}"
Explicit definition of an additional properties source makes sense for locally launched applications but may pose a security risk with remotely launched applications (see #37) where you’d want the property source to come from the same trusted host (and adjacent location perhaps) as the layers config file. An implicit mode could be implemented
- Given the path of the config layers file replace the filename extension with
.properties
. If a match is found, use it. - Given the path of the config layers file, locate a file named
layrry.properties
. If a match is found, use it. - If there are no matches in 1) and 2) then no implicit property sources will be used.
Of course, explicit declaration such as --properties my-props.properties
win over implicit, such that if the explicit file is not found then no implicit search will be performed.
Issue Analytics
- State:
- Created 3 years ago
- Comments:16 (16 by maintainers)
Top GitHub Comments
👍
I still think it should then be 4 > 1 > 2&3, but let’s cross that bridge when we get there 😃
Done.