Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@ tasks.register("stop") {
}

buildDockerImage {
doFirst {
waitForCommand("docker pull ${gradle.liferayWorkspace.dockerImageLiferay}", null, true)
}

onlyIf("using the Liferay service") {
config.useLiferay
}
Expand Down
11 changes: 7 additions & 4 deletions buildSrc/src/main/groovy/docker-common.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -339,7 +342,7 @@ ext {

execResult.assertNormalExitValue()

return stdout.toString().trim()
return byteArrayOutputStream.toString().trim()
}

waitForContainer = {
Expand Down
4 changes: 2 additions & 2 deletions buildSrc/src/main/groovy/docker-liferay-bundle.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,9 @@ Closure<FileCollection> 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}")
waitForCommand("docker pull ${imageName}", null, true)

latestImageName = getLatestImageNameLocal(imageName)

Expand Down