Grails Cookbook - A collection of tutorials and examples

How To Check If Environment is Test, Development, or Production in Grails

Sometimes it is very helpful to execute some code depending on which environment you are in. For example, you may want to insert test data inside Bootstrap when you run the application in development mode, but not in production mode.
This is simple in Grails on different sections of your application.