Skip to content

Commit 8a4412d

Browse files
committed
LPD-55579 fixes build error when no Docker containers have yet started
1 parent 44f262f commit 8a4412d

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

buildSrc/src/main/groovy/docker-liferay-bundle.gradle

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import com.liferay.docker.workspace.environments.Util
33
import de.undercouch.gradle.tasks.download.Download
44

55
import groovy.json.JsonSlurper
6+
67
import groovy.xml.XmlSlurper
78
import groovy.xml.slurpersupport.GPathResult
89

@@ -288,14 +289,14 @@ tasks.register("listAdminUsers") {
288289
config.useDatabase
289290
}
290291

291-
JsonSlurper jsonSlurper = new JsonSlurper()
292+
Closure<Void> listAdminUsersForCompany = {
293+
String companyId, String hostname, String webId, String schema ->
292294

293-
String networkPorts = waitForCommand("docker inspect ${config.namespace}-liferay --format '{{ json .NetworkSettings.Ports }}'")
295+
JsonSlurper jsonSlurper = new JsonSlurper()
294296

295-
String tcp8080Port = jsonSlurper.parseText(networkPorts)["8080/tcp"][0]["HostPort"]
297+
String networkPorts = waitForCommand("docker inspect ${config.namespace}-liferay --format '{{ json .NetworkSettings.Ports }}'")
296298

297-
Closure<Void> listAdminUsersForCompany = {
298-
String companyId, String hostname, String webId, String schema ->
299+
String tcp8080Port = jsonSlurper.parseText(networkPorts)["8080/tcp"][0]["HostPort"]
299300

300301
List results = executeSQLQuery("select screenName, emailAddress from User_ where companyId = ${companyId} and userId in (select userId from Users_Roles where roleId in (select roleId from Role_ where name = 'Administrator'))", schema)
301302

0 commit comments

Comments
 (0)