2

Grails seems to build the artefacts per env.

with the command "grails -Dgrails.env=test war

Is it possible for me to override the running environment programmatically?

The issue here is that we produce the war file using production env config. But I want to run the same war file in other environments, like Test, Staging, DR etc.

There are two options: 1. set grails.env in command line 2. programmatically set the current env in the code.

I wonder how could I achieve option2. Our deploy script is shared, not grails specific. There is a generic environment variable named SYSTEM is passed in command line. If I could map that env to the grails.env in code, that would be idea.

ryang
  • 151
  • 5
  • 2
    No need to change environment, change whatever you want to change dynamically by external config which is loaded under the every environment and reload config dynamically, config may contains your database name and credentials, any flag value etc. – Nitin Dhomse Jan 15 '18 at 09:13

0 Answers0