I am running multiple Gatling projects in a setting where we have multiple environments. I would like to create a .conf file for each environment, and then specify which configuration file to read on the command line. I want these conf files to be shared, not duplicated per project.
My layout should be something like this:
/src /common (libraries) /conf /project1 /project2 /project3
Where each project folder looks like this
`
/project
/archive - saved results
/data
/results
/simulations
run.sh
`
I want my config files to be found when I do ConfigFactory.load( “env-name.conf” )
If the .conf file is in the project root, which is the active directory when I launch run.sh, then it works.
If I put the full path to the file in my code, e.g. ConfigFactory.load( “/src/common/conf/env-name.conf” ) then it also works.
But if I try to load “env-name.conf” by adding /src/common/conf to my classpath, that does NOT work.
But supposedly, I could put all my configuration into a single “resources.conf” and put that on the classpath, and that would work. The primary reason I do not is because I do not want a giant config file. Generally speaking, I only need a subset of the config. And I am paranoid about having everything in one file, where the whole thing could get corrupted by a careless edit.
I’d like the advice of the Scala experts out there. What would you do if you were me?
- Would you just put them all into one config, and trust people not to screw it up?
- Would you keep them in separate files, and pass the full path to the files?
- Or is there another option I have not thought of?
Thanks for your input.