Skip to content

Commit 1605dd6

Browse files
committed
Don't pass OPENSHIFT_IP env variable when building old BWC branches
This commit tweaks the workaround introduced in elastic#49211 to support Gradle 6.0. In the workaround, we specifically override the address the Gradle daemon binds to by passing the desired address via the OPENSHIFT_IP environment variable. This works fine for builds using Gradle 6.0, but for older Gradle versions this causes issues with inter-daemon communication, specifically when we build BWC branches not on Gradle 6.0. The fix here is to strip that environment variable out when building the target BWC branch if that branch is on an older Gradle version. This is all temporary and will be removed when this bug fix is released in Gradle 6.1. Closes elastic#50025 Signed-off-by: Mark Vieira <[email protected]>
1 parent a3482e8 commit 1605dd6

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

distribution/bwc/build.gradle

+8
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import org.elasticsearch.gradle.Version
2323
import org.elasticsearch.gradle.BwcVersions
2424
import org.elasticsearch.gradle.info.BuildParams
2525
import org.elasticsearch.gradle.info.GlobalBuildInfoPlugin
26+
import org.gradle.util.GradleVersion
2627

2728
import java.nio.charset.StandardCharsets
2829

@@ -161,6 +162,13 @@ bwcVersions.forPreviousUnreleased { BwcVersions.UnreleasedVersionInfo unreleased
161162
spoolOutput = true
162163
workingDir = checkoutDir
163164
doFirst {
165+
// TODO: Remove this once we've updated to Gradle 6.1
166+
// Workaround for https://github.com/gradle/gradle/issues/11426
167+
if (GradleVersion.version(file("${ checkoutDir}/buildSrc/src/main/resources/minimumGradleVersion").text) != GradleVersion.current()) {
168+
environment = environment.findAll { key, val -> key != 'OPENSHIFT_IP' }
169+
environment.forEach { key, val -> println("$key=$val") }
170+
}
171+
164172
// Execution time so that the checkouts are available
165173
List<String> lines = file("${checkoutDir}/.ci/java-versions.properties").readLines()
166174
environment(

0 commit comments

Comments
 (0)