I have been developing several Grails applications over the past couple of years. I am increasingly finding that the three grails environments (dev, test, prod) aren't enough to satisfy my needs. The more "enterprisey" your application gets, the more environments you tend to have.
I tend to use 6 environments for my development cycle...
DEVA //My dev
DEVB //Team mates dev
CI_TEST //CI like Hudson
QA_TEST //Testing team environment
UAT_TEST //Customers testing environment
PROD //Production
Im wondering if there is a way to define custom Grails environments? I dont think there is, but the feature could be handy.
The way I am getting around this right now is by externalising the config to a properties file.
Id imagine that this is a pretty common requirement, so how have you been dealing with your environments?
Config.groovy and DataSource.groovy both support custom environments (I'm pretty sure most other config files do as well).
If you want to start up your app or package it for a custom env you use
grails -Dgrails.env=myCustomEnv run-app
Then in Config you would have
environments{
myCustomEnv{
myProp = 'myVal'
}
}
I couldn't find a page in the user guide about it but we use them like this to have beta and uat environment settings.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With