Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to override default Grails environment?

Grails allows you to define different "environments" for your app inside Config.groovy like so:

environments {
    development {
        ...
    }
    demo {
        ...
    }
    production {
        ...
    }
}

Thus you can run your app like so:

grails -Dgrails.env=demo run-app

...and Grails will run your app in "demo" environment mode. The default is development, so if you just execute:

grails run-app

...it's the same as:

grails -Dgrails.env=development run-app

However I was wondering if it is possible (and if so, how) to override development as the default and make it, say, demo? Such that:

grails run-app

...is equivalent to:

grails -Dgrails.env=demo run-app

Thoughts?

like image 663
IAmYourFaja Avatar asked May 28 '14 15:05

IAmYourFaja


1 Answers

However I was wondering if it is possible (and if so, how) to override development as the default

No, this is not possible. Incidentally, the default environment depends on the command, e.g.

  • the default environment for run-app is development
  • the default environment for test-app is test
  • the default environment for war is production
like image 133
Dónal Avatar answered Oct 17 '22 14:10

Dónal