1 | /** |
---|
2 | * External application config file. |
---|
3 | * This is a full Groovy ConfigSlurper file but don't let that scare you :-) |
---|
4 | * Normally just set your database settings in the Required Settings section. |
---|
5 | * Usage: |
---|
6 | * This file must be placed on the classpath, for example in ONE of the following: |
---|
7 | * $CATALINA_BASE/lib/ |
---|
8 | * $CATALINA_HOME/lib/ |
---|
9 | * /var/lib/tomcat5.5/common/lib/ (Debian Tomcat5.5) |
---|
10 | * /var/lib/tomcat6/common/classes/ (Debian Tomcat6) |
---|
11 | * or in the root of a grails application (development). |
---|
12 | * More: |
---|
13 | * Grails user guide - 3.3 The DataSource and 3.4 Externalized Configuration |
---|
14 | * http://grails.org/doc/latest/guide/ |
---|
15 | * http://groovy.codehaus.org/ConfigSlurper |
---|
16 | */ |
---|
17 | |
---|
18 | /******************* |
---|
19 | Init, please ignore. |
---|
20 | *******************/ |
---|
21 | def appName = grails.util.Metadata.current.'app.name' |
---|
22 | def appNameLowerCase = appName.toLowerCase() |
---|
23 | println "EXT($appName): External config start." |
---|
24 | |
---|
25 | /*********************************** |
---|
26 | Required Settings, please set these. |
---|
27 | ************************************/ |
---|
28 | |
---|
29 | environments { |
---|
30 | production { |
---|
31 | println "EXT($appName): Configure production datasource." |
---|
32 | |
---|
33 | // Enable ONE dataSource with your database settings. |
---|
34 | // Delete dbCreate line after setup! |
---|
35 | dataSource { |
---|
36 | /** HSQLDB - In memory */ |
---|
37 | // driverClassName = "org.hsqldb.jdbcDriver" |
---|
38 | // username = "sa" |
---|
39 | // password = "" |
---|
40 | // dbCreate = "create-drop" |
---|
41 | // url = "jdbc:hsqldb:mem:devDb" |
---|
42 | /** HSQLDB - In file */ |
---|
43 | // driverClassName = "org.hsqldb.jdbcDriver" |
---|
44 | // username = "sa" |
---|
45 | // password = "" |
---|
46 | // dbCreate = "update" |
---|
47 | // url = "jdbc:hsqldb:file:prodDb;shutdown=true" |
---|
48 | /** MSSQL */ |
---|
49 | //For more info see the docs that you downloaded with the driver. |
---|
50 | // dialect = org.hibernate.dialect.SQLServerDialect // MSSQL 2000+2005 Useful with `grails schema-export` |
---|
51 | // driverClassName = "com.microsoft.sqlserver.jdbc.SQLServerDriver" |
---|
52 | // username = "${appNameLowerCase}admin" |
---|
53 | // password = "${appNameLowerCase}admin" |
---|
54 | // dbCreate = "update" |
---|
55 | // url = "jdbc:sqlserver://${appNameLowerCase}sql01:1433;databaseName=${appNameLowerCase}_prod" |
---|
56 | /** MySQL */ |
---|
57 | dialect = org.hibernate.dialect.MySQL5InnoDBDialect |
---|
58 | driverClassName = "com.mysql.jdbc.Driver" |
---|
59 | username = "${appNameLowerCase}admin" |
---|
60 | password = "${appNameLowerCase}admin" |
---|
61 | dbCreate = "update" |
---|
62 | url = "jdbc:mysql://${appNameLowerCase}sql01:3306/${appNameLowerCase}_prod?autoReconnect=true&sessionVariables=storage_engine=InnoDB" |
---|
63 | } |
---|
64 | } |
---|
65 | } |
---|
66 | |
---|
67 | // It is highly recommended to limit the currencyList to the ONE that the site uses e.g: |
---|
68 | // 'EUR', 'XCD', 'USD', 'XOF', 'NOK', 'AUD', 'XAF', 'TRL' |
---|
69 | // 'NZD', 'MAD', 'DKK', 'GBP', 'CHF', 'XPF', 'ILS', 'ROL' |
---|
70 | currencyList = ['AUD'] |
---|
71 | |
---|
72 | /******************* |
---|
73 | Optional Settings. |
---|
74 | *******************/ |
---|
75 | |
---|
76 | // Set true to enable demo mode and create demo data. |
---|
77 | demoMode.enabled = false |
---|
78 | |
---|
79 | // Task generation interval, increase value to reduce system load. |
---|
80 | taskRecurringScheduleJob.repeatInterval = 10 |
---|
81 | |
---|
82 | /******************* |
---|
83 | Exit Functions. |
---|
84 | *******************/ |
---|
85 | |
---|
86 | if(demoMode.enabled) { |
---|
87 | println "EXT($appName): Demo mode enabled." |
---|
88 | currencyList = ['EUR', 'XCD', 'USD', 'XOF', 'NOK', 'AUD', 'XAF', 'TRL', |
---|
89 | 'NZD', 'MAD', 'DKK', 'GBP', 'CHF', 'XPF', 'ILS', 'ROL'] |
---|
90 | } |
---|
91 | |
---|
92 | println "EXT($appName): External config end." |
---|