Greetings all, I'm a newcomer to the JVM realm. I'm interested in examples of crafting a build script capable of substituting parameters within a configuration file (such as application.config) with secrets and environment variables sourced from GitHub during the deployment process.
v
Vampire
03/27/2024, 8:50 AM
Assuming with "during deployment process" you mean at build time, you can just have placeholders in your resource file that you then expand by configuring the
processResources
task, for example using
expand(...)
. Make sure to also use
filesMatching
to only work on intended files and to set the filter encoding appropriately. But also consider maybe not baking in such secrets, but supplying them at runtime somehow.