File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change 5959 return
6060 }
6161
62+ File lcpJsonFile = new File (config. lxcRepositoryPath, " liferay/LCP.json" )
63+
64+ if (! lcpJsonFile. exists()) {
65+ println " Unable to copy configurations from LXC repository, because ${ config.lxcRepositoryPath} is not the liferay-lxc repository"
66+
67+ return
68+ }
69+
6270 File environmentFolder = null
6371
6472 if (config. lxcEnvironmentName == null ) {
@@ -112,6 +120,27 @@ ext {
112120 return
113121 }
114122
123+ JsonSlurper jsonSlurper = new JsonSlurper ()
124+
125+ Map<String , String > environmentVariables = jsonSlurper. parse(lcpJsonFile)[" environments" ][config. lxcEnvironmentName]
126+
127+ String jdbcURL = environmentVariables[" LIFERAY_JDBC_PERIOD_DEFAULT_PERIOD_URL" ]
128+
129+ if (jdbcURL != null && jdbcURL. startsWith(" jdbc:postgresql://" )) {
130+ config. useDatabasePostgreSQL = true
131+
132+ updateGradleLocalProperties([
133+ " lr.docker.environment.service.enabled[postgres]" : " true"
134+ ])
135+ }
136+ else {
137+ config. useDatabaseMySQL = true
138+
139+ updateGradleLocalProperties([
140+ " lr.docker.environment.service.enabled[mysql]" : " true"
141+ ])
142+ }
143+
115144 if (! config. databasePartitioningEnabled) {
116145 config. databasePartitioningEnabled = true
117146
You can’t perform that action at this time.
0 commit comments