Skip to content

Commit

Permalink
Cleanup BWC projects for versions bigger than 7.12 (elastic#79173) (e…
Browse files Browse the repository at this point in the history
…lastic#79233)

This should fix the failing release build.
More cleanup on the ES build is required and will be done in a
follow up PR
  • Loading branch information
breskeby authored Oct 15, 2021
1 parent aee722d commit 0d7835e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,18 +66,16 @@ class InternalDistributionBwcSetupPluginFuncTest extends AbstractGitAwareGradleF
"""
when:
def result = gradleRunner(":distribution:bwc:${bwcProject}:buildBwcDarwinTar",
":distribution:bwc:${bwcProject}:buildBwcOssDarwinTar",
":distribution:bwc:${bwcProject}:buildBwcDarwinTar",
"-DtestRemoteRepo=" + remoteGitRepo,
"-Dbwc.remote=origin",
"-Dbwc.dist.version=${bwcDistVersion}-SNAPSHOT")
.build()
then:
result.task(":distribution:bwc:${bwcProject}:buildBwcDarwinTar").outcome == TaskOutcome.SUCCESS
result.task(":distribution:bwc:${bwcProject}:buildBwcOssDarwinTar").outcome == TaskOutcome.SUCCESS

and: "assemble task triggered"
assertOutputContains(result.output, "[$bwcDistVersion] > Task :distribution:archives:darwin-tar:${expectedAssembleTaskName}")
assertOutputContains(result.output, "[$bwcDistVersion] > Task :distribution:archives:oss-darwin-tar:${expectedAssembleTaskName}")

where:
bwcDistVersion | bwcProject | expectedAssembleTaskName
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,18 +166,22 @@ private void registerDistributionArchiveArtifact(Project bwcProject, Distributio

private static List<DistributionProject> resolveArchiveProjects(File checkoutDir, Version bwcVersion) {
List<String> projects = new ArrayList<>();
// All active BWC branches publish default and oss variants of rpm and deb packages
projects.addAll(asList("deb", "rpm", "oss-deb", "oss-rpm"));

if (bwcVersion.onOrAfter("7.0.0")) { // starting with 7.0 we bundle a jdk which means we have platform-specific archives
projects.addAll(asList("oss-windows-zip", "windows-zip", "oss-darwin-tar", "darwin-tar", "oss-linux-tar", "linux-tar"));

// We support aarch64 for linux and mac starting from 7.12
if (bwcVersion.onOrAfter("7.12.0")) {
projects.addAll(asList("oss-darwin-aarch64-tar", "oss-linux-aarch64-tar", "darwin-aarch64-tar", "linux-aarch64-tar"));
if (bwcVersion.onOrAfter("7.13.0")) {
projects.addAll(asList("deb", "rpm"));
projects.addAll(asList("windows-zip", "darwin-tar", "linux-tar"));
projects.addAll(asList("darwin-aarch64-tar", "linux-aarch64-tar"));
} else {
projects.addAll(asList("deb", "rpm", "oss-deb", "oss-rpm"));
if (bwcVersion.onOrAfter("7.0.0")) { // starting with 7.0 we bundle a jdk which means we have platform-specific archives
projects.addAll(asList("oss-windows-zip", "windows-zip", "oss-darwin-tar", "darwin-tar", "oss-linux-tar", "linux-tar"));

// We support aarch64 for linux and mac starting from 7.12
if (bwcVersion.onOrAfter("7.12.0")) {
projects.addAll(asList("oss-darwin-aarch64-tar", "oss-linux-aarch64-tar", "darwin-aarch64-tar", "linux-aarch64-tar"));
}
} else { // prior to 7.0 we published only a single zip and tar archives for oss and default distributions
projects.addAll(asList("oss-zip", "zip", "tar", "oss-tar"));
}
} else { // prior to 7.0 we published only a single zip and tar archives for oss and default distributions
projects.addAll(asList("oss-zip", "zip", "tar", "oss-tar"));
}

return projects.stream().map(name -> {
Expand Down

0 comments on commit 0d7835e

Please sign in to comment.