Changeset 1360


Ignore:
Timestamp:
Jan 11, 2011, 3:14:21 PM (12 years ago)
Author:
work@…
Message:
  • moving application configuration out of Config.groovy and Datasource.groovy
  • default configuration is stored in gscf/environment-config.properties
  • override in ~/.grails-config/gscf-environment-config.properties!
  • resolves #219
Location:
trunk
Files:
7 added
2 edited

Legend:

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

    r1347 r1360  
    1616// locations to search for config files that get merged into the main config
    1717// config files can either be Java properties files or ConfigSlurper scripts
    18 
    19 // grails.config.locations = [ "classpath:${appName}-config.properties",
    20 //                             "classpath:${appName}-config.groovy",
    21 //                             "file:${userHome}/.grails/${appName}-config.properties",
    22 //                             "file:${userHome}/.grails/${appName}-config.groovy"]
    23 
    24 // if(System.properties["${appName}.config.location"]) {
    25 //    grails.config.locations << "file:" + System.properties["${appName}.config.location"]
    26 // }
     18grails.config.locations = [
     19        // the WAR default location
     20        "classpath:${grails.util.GrailsUtil.environment}-config.properties",
     21        // the run-app default location
     22        "file:${basedir}/${grails.util.GrailsUtil.environment}-config.properties",
     23        // the external configuration
     24        "file:${userHome}/.grails-config/${appName}-${grails.util.GrailsUtil.environment}-config.properties"
     25]
     26
    2727grails.mime.file.extensions = true // enables the parsing of file extensions from URLs into the request format
    2828grails.mime.use.accept.header = false
     
    4747// enabled native2ascii conversion of i18n properties files
    4848grails.enable.native2ascii = true
    49 
    50 // set per-environment serverURL stem for creating absolute links
    51 environments {
    52         development {
    53                 grails.serverURL = "http://localhost:8080/${appName}"
    54                 modules {
    55                         sam {
    56                                 url = "http://localhost:8182/sam"
    57                         }
    58                         metabolomics {
    59                                 url = "http://localhost:8183/nmcdsp"
    60                         }
    61                         metagenomics {
    62                                 url = "http://localhost:8184/metagenomics"
    63                         }
    64                 }
    65         }
    66         ci {
    67                 // used by build script
    68                 grails.serverURL = "http://ci.gscf.nmcdsp.org"
    69                 modules {
    70                         sam {
    71                                 url = "http://ci.sam.nmcdsp.org"
    72                         }
    73                         metabolomics {
    74                                 url = "http://ci.metabolomics.nmcdsp.org"
    75                         }
    76                         metagenomics {
    77                                 url = "http://ci.metagenomics.nmcdsp.org"
    78                         }                       
    79                 }
    80         }
    81         test {
    82                 // used by build script
    83                 grails.serverURL = "http://test.gscf.nmcdsp.org"
    84                 modules {
    85                         sam {
    86                                 url = "http://test.sam.nmcdsp.org"
    87                         }
    88                         metabolomics {
    89                                 url = "http://test.metabolomics.nmcdsp.org"
    90                         }
    91                 }
    92         }
    93         dbnptest {
    94                 // used by build script
    95                 grails.serverURL = "http://test.dbnp.org"
    96                 modules {
    97                         sam {
    98                                 url = "http://test.sam.dbnp.org"
    99                         }
    100                         metabolomics {
    101                                 url = "http://test.metabolomics.dbnp.org"
    102                
    103                         }
    104                 }
    105         }
    106         dbnpdemo {
    107                 // used by build script
    108                 grails.serverURL = "http://demo.dbnp.org"
    109                 modules {
    110                         sam {
    111                                 url = "http://demo.sam.dbnp.org"
    112                         }
    113                         metabolomics {
    114                                 url = "http://demo.metabolomics.dbnp.org"
    115                         }
    116                 }
    117         }
    118         production {
    119                 grails.serverURL = "http://www.nmcdsp.org"
    120                 modules {
    121                         sam {
    122                                 url = "http://sam.nmcdsp.org"
    123                         }
    124                         metabolomics {
    125                                 url = "http://metabolomics.nmcdsp.org"
    126                         }
    127                 }
    128         }
    129         www {
    130                 // used by build script
    131                 grails.serverURL = "http://www.nmcdsp.org"
    132                 modules {
    133                         sam {
    134                                 url = "http://sam.nmcdsp.org"
    135                         }
    136                         metabolomics {
    137                                 url = "http://metabolomics.nmcdsp.org"
    138                         }
    139                 }
    140         }
    141 }
    14249
    14350// log4j configuration
     
    277184]
    278185
    279 // Needed for sending emails
     186// default mail configuration, see environment specific properties file
     187// for real configuration
    280188grails {
    281189        mail {
    282190                host = "smtp.gmail.com"
    283191                port = 465
    284                 username = "gscfproject@gmail.com"
    285                 password = "gscf2010"
     192                username = "default_login@gmail.com"
     193                password = "default_password"
    286194                props = [
    287195                        "mail.smtp.auth": "true",
  • trunk/grails-app/conf/DataSource.groovy

    r1133 r1360  
     1/**
     2 * Default datasource configuration
     3 *
     4 * See environment specific configuration!
     5 *
     6 * @author Jeroen Wesbeek
     7 * @since 20110110
     8 *
     9 * Revision information:
     10 * $Rev$
     11 * $Author$
     12 * $Date$
     13 */
    114dataSource {
    215        pooled = true
    316        driverClassName = "org.hsqldb.jdbcDriver"
     17        dbCreate = "create-drop" // one of 'create', 'create-drop','update'
     18        url = "jdbc:hsqldb:mem:devDB"
    419        username = "sa"
    520        password = ""
     
    1025        cache.provider_class = 'net.sf.ehcache.hibernate.EhCacheProvider'
    1126}
    12 // environment specific settings
    13 environments {
    14         development {
    15                 dataSource {
    16                         // by default we use an in memory development database
    17                         dbCreate = "create-drop" // one of 'create', 'create-drop','update'
    18                         url = "jdbc:hsqldb:mem:devDB"
    19                         //loggingSql = true
    20                 }
    21         }
    22         ci {
    23                 // used by build script
    24                 dataSource {
    25                         dbCreate = "update"
    26                         username = "gscf"
    27                         password = "dbnp"
    28 
    29                         // PostgreSQL
    30                         driverClassName = "org.postgresql.Driver"
    31                         url = "jdbc:postgresql://localhost:5432/gscf-ci"
    32                         dialect = org.hibernate.dialect.PostgreSQLDialect
    33                         //logSql = true // enable logging while not yet final
    34                 }
    35         }
    36         test {
    37                 dataSource {
    38                         dbCreate = "update"
    39                         username = "gscf"
    40                         password = "dbnp"
    41 
    42                         // PostgreSQL
    43                         driverClassName = "org.postgresql.Driver"
    44                         url = "jdbc:postgresql://localhost:5432/gscf-test"
    45                         dialect = org.hibernate.dialect.PostgreSQLDialect
    46                         //logSql = true // enable logging while not yet final
    47                 }
    48         }
    49         dbnptest {
    50                 dataSource {
    51                         dbCreate = "update"
    52                         username = "gscf"
    53                         password = "dbnp"
    54 
    55                         // PostgreSQL
    56                         driverClassName = "org.postgresql.Driver"
    57                         url = "jdbc:postgresql://localhost:5432/gscf-test"
    58                         dialect = org.hibernate.dialect.PostgreSQLDialect
    59                         //logSql = true // enable logging while not yet final
    60                 }
    61         }
    62         dbnpdemo {
    63                 dataSource {
    64                         dbCreate = "update"
    65                         username = "gscf"
    66                         password = "dbnp"
    67 
    68                         // PostgreSQL
    69                         driverClassName = "org.postgresql.Driver"
    70                         url = "jdbc:postgresql://localhost:5432/gscf-demo"
    71                         dialect = org.hibernate.dialect.PostgreSQLDialect
    72                         //logSql = true // enable logging while not yet final
    73                 }
    74         }
    75         production {
    76                 dataSource {
    77                         dbCreate = "update"
    78                         username = "gscf"
    79                         password = "dbnp"
    80 
    81                         // PostgreSQL
    82                         driverClassName = "org.postgresql.Driver"
    83                         url = "jdbc:postgresql://localhost:5432/gscf-www"
    84                         dialect = org.hibernate.dialect.PostgreSQLDialect
    85                         //logSql = true // enable logging while not yet final
    86                 }
    87         }
    88         www {
    89                 // used by build script
    90                 dataSource {
    91                         dbCreate = "update"
    92                         username = "gscf"
    93                         password = "dbnp"
    94 
    95                         // PostgreSQL
    96                         driverClassName = "org.postgresql.Driver"
    97                         url = "jdbc:postgresql://localhost:5432/gscf-www"
    98                         dialect = org.hibernate.dialect.PostgreSQLDialect
    99                         //logSql = true // enable logging while not yet final
    100                 }
    101         }
    102 }
Note: See TracChangeset for help on using the changeset viewer.