I would like to load Environment specific configurations in my grails application so that depending on which JVM the grails application is running on, I can point to that environment specific urls. In my case, I have 4 different environments to work with (instead of the default 3 that grails app assumes) when my app goes from dev to prod.
My JVMs all have a System property defined that, when I do "System.getProperty()", tell me which environment that application is running on.
My question is, what is the best place to check and load the environment-specific configurations during run-time? Inside BootStrap.groovy? I do not have the option to build my war file using command line or grails {env_name} war.
Thanks.
run-app
then you can pass environment name along withrun-app
command. If you deploy it for example in Tomcat you create war which is environment specific and you can choose environment while building war (grails <env_name> war
). It's all described quite nicely in linked documentation page in section 'Packaging and Running for Different Environments'. – Bukovina