Changeset 504 for trunk/grails-app


Ignore:
Timestamp:
Apr 22, 2010, 3:15:10 PM (15 years ago)
Author:
gav
Message:

Adjust BootStrap.groovy since it is now environment aware.
Small spelling correction to DataSource?.groovy

Location:
trunk/grails-app/conf
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/conf/BootStrap.groovy

    r270 r504  
    1 import grails.util.GrailsUtil
    2 
    31class BootStrap
    42{
     
    75    def init = { servletContext ->
    86
    9         log.info "Application starting."
    10         log.debug "GrailsUtil.environment = ${GrailsUtil.environment}"
    11 
    12         switch (GrailsUtil.environment)
    13         {
    14             case "development":
    15                         createDataService.ensureSystemAndAdminAccess()
    16                         createDataService.createBaseData()
    17                         createDataService.createDemoData()
    18                         break
    19             case "test":
    20                         createDataService.ensureSystemAndAdminAccess()
    21                         break
    22             case "production":
    23                         createDataService.ensureSystemAndAdminAccess()
    24                         break
     7        /** Environment specific settings.
     8        * Note that (circa grails-1.2.2) if running "test test-app integration:" from "grails interactive"
     9        * the correct environment is applied for DataSource and Config,
     10        * but for BootStrap (and others) the development environment is applied.
     11        */
     12        environments {
     13            development {
     14                log.info "Starting DEVELOPMENT bootstrap."
     15                createDataService.ensureSystemAndAdminAccess()
     16                createDataService.createBaseData()
     17                createDataService.createDemoData()
     18            }
     19            test {
     20                log.info "Starting TEST bootstrap."
     21                createDataService.ensureSystemAndAdminAccess()
     22            }
     23            production {
     24                log.info "Starting PRODUCTION bootstrap."
     25                createDataService.ensureSystemAndAdminAccess()
     26            }
    2527        }
    2628
    27     }
     29    } // init
    2830
    2931    def destroy = {
    3032    }
    31 }
     33
     34} // end class
  • trunk/grails-app/conf/DataSource.groovy

    r449 r504  
    2424            password = ""
    2525            dbCreate = "create-drop"
    26             url = "jdbc:hsqldb:mem:devDB"
     26            url = "jdbc:hsqldb:mem:devDb"
    2727            /** MySQL */
    2828//             driverClassName = "com.mysql.jdbc.Driver"
     
    5757//             password = ""
    5858//             dbCreate = "create-drop"
    59 //             url = "jdbc:hsqldb:mem:devDB"
     59//             url = "jdbc:hsqldb:mem:devDb"
    6060            /** HSQLDB - In file */
    6161//             driverClassName = "org.hsqldb.jdbcDriver"
Note: See TracChangeset for help on using the changeset viewer.