Greetings all, I'm a newcomer to the JVM realm. I'...
# gradle
m
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
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.
v
You really should set the filtering charset, unless you are super sure that you only use basic ASCII in that file. :-)
s
true I did just grab those quickly bc ik that this example project used the task to do that already so it's a decent example
👌 1
👊 1