From 9d40c8c4460100a336bc22e3e041ce58dec5245b Mon Sep 17 00:00:00 2001 From: Kyle Miho Date: Wed, 8 Oct 2025 16:15:54 -0700 Subject: [PATCH 1/3] LPD-66476 Add additional parameter to waitForCommand to allow the output of the command to be displayed in the console --- buildSrc/src/main/groovy/docker-common.gradle | 11 +++++++---- buildSrc/src/main/groovy/docker-liferay-bundle.gradle | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/buildSrc/src/main/groovy/docker-common.gradle b/buildSrc/src/main/groovy/docker-common.gradle index 63a605c..14a9c5b 100644 --- a/buildSrc/src/main/groovy/docker-common.gradle +++ b/buildSrc/src/main/groovy/docker-common.gradle @@ -323,14 +323,17 @@ ext { } waitForCommand = { - String command, File cwd = null -> + String command, File cwd = null, boolean streamOutput = false -> - ByteArrayOutputStream stdout = new ByteArrayOutputStream() + ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream() ExecResult execResult = project.exec { commandLine "bash", "-c", command ignoreExitValue true - standardOutput stdout + + if (streamOutput == false) { + standardOutput byteArrayOutputStream + } if (cwd != null) { workingDir cwd @@ -339,7 +342,7 @@ ext { execResult.assertNormalExitValue() - return stdout.toString().trim() + return byteArrayOutputStream.toString().trim() } waitForContainer = { diff --git a/buildSrc/src/main/groovy/docker-liferay-bundle.gradle b/buildSrc/src/main/groovy/docker-liferay-bundle.gradle index 81771d5..ea4b459 100644 --- a/buildSrc/src/main/groovy/docker-liferay-bundle.gradle +++ b/buildSrc/src/main/groovy/docker-liferay-bundle.gradle @@ -119,7 +119,7 @@ Closure copyLiferayLicenseFromDXPImage = { println "Docker image ${imageName} is not available, retrieving via docker pull (this may take awhile)" - waitForCommand("docker pull ${imageName}") + waitForCommand("docker pull ${imageName}", null, true) latestImageName = getLatestImageNameLocal(imageName) From 4db473dcff953f8d2ec7e484763bca7c2e4d0a6d Mon Sep 17 00:00:00 2001 From: Kyle Miho Date: Wed, 8 Oct 2025 16:17:24 -0700 Subject: [PATCH 2/3] LPD-66476 Pre-pull Liferay docker image of the version we want to use so we can display its download progress --- build.gradle | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/build.gradle b/build.gradle index 8e6791b..d0e3374 100644 --- a/build.gradle +++ b/build.gradle @@ -124,6 +124,10 @@ tasks.register("stop") { } buildDockerImage { + doFirst { + waitForCommand("docker pull ${gradle.liferayWorkspace.dockerImageLiferay}", null, true) + } + onlyIf("using the Liferay service") { config.useLiferay } From b8c9659d2ff91f5b437ca4ee1abf5d716f81b3ca Mon Sep 17 00:00:00 2001 From: Kyle Miho Date: Wed, 8 Oct 2025 16:17:51 -0700 Subject: [PATCH 3/3] LPD-66476 Update logging for pulling images --- buildSrc/src/main/groovy/docker-liferay-bundle.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildSrc/src/main/groovy/docker-liferay-bundle.gradle b/buildSrc/src/main/groovy/docker-liferay-bundle.gradle index ea4b459..68254aa 100644 --- a/buildSrc/src/main/groovy/docker-liferay-bundle.gradle +++ b/buildSrc/src/main/groovy/docker-liferay-bundle.gradle @@ -117,7 +117,7 @@ Closure copyLiferayLicenseFromDXPImage = { return null } - println "Docker image ${imageName} is not available, retrieving via docker pull (this may take awhile)" + println "Checking image ${imageName} for a valid license file to copy, retrieving via docker pull (this may take awhile)" waitForCommand("docker pull ${imageName}", null, true)