Enonic version: 7.4
Beautiful people of the Enonic community, I need some ideas here!
I’m in the need to add config for my app. That’s fair enough, the good old trick to use
[app.name].cfg for app specific settings are great. But, I need to do have different sets of config based on what environment we’re in: LOCAL, DEV, TEST, PROD. So, my initial idea is to just group my settings in the
dev.url1=xxx or something like that. And then within my controllers use the
req object and the current server URL to figure out which environment we’re in. In theory I guess this could work. Any other ideas out there?
The reason I need this environment-specific setup is because of multiple reason, but we use a few different CDNs (based on mimetype), and our CDNs also run in different environments. This is why I need a config that understand where it is and serves me different values based on that fact.
We also build automatically and deploy to the cloud whenever we merge into master, so having these strings outside of our app-code and rather inside our docker-config (two different repoes) would be nice. Obviously, putting all this logic within our app could pull the job off, but wouldn’t be so sexy to maintain.
Makes sense? Give me your thoughts. Peace!