Fix Snapshot pattern in DistributionDownloader. (#916) (#920)

Snapshots are published with a -latest flag into s3, this updates
the pattern to correctly point to -latest.

Signed-off-by: Marc Handalian <handalm@amazon.com>
This commit is contained in:
Marc Handalian 2021-07-01 19:59:41 -07:00 committed by GitHub
parent b749b38043
commit 36401d9edb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -68,7 +68,7 @@ class DistributionDownloadFixture {
platform == OpenSearchDistribution.Platform.DARWIN)) ? "tar.gz" : "zip"
if (Version.fromString(version).onOrAfter(Version.fromString("1.0.0"))) {
if (version.contains("SNAPSHOT")) {
return "/snapshots/core/opensearch/${version}/opensearch-min-${version}-${platform}-x64.$fileType"
return "/snapshots/core/opensearch/${version}/opensearch-min-${version}-${platform}-x64-latest.$fileType"
}
return "/releases/core/opensearch/${version}/opensearch-min-${version}-${platform}-x64.$fileType"
} else {

View File

@ -79,7 +79,7 @@ public class DistributionDownloadPlugin implements Plugin<Project> {
private static final String RELEASE_PATTERN_LAYOUT = "/core/opensearch/[revision]/[module]-min-[revision](-[classifier]).[ext]";
private static final String SNAPSHOT_PATTERN_LAYOUT =
"/snapshots/core/opensearch/[revision]/[module]-min-[revision](-[classifier]).[ext]";
"/snapshots/core/opensearch/[revision]/[module]-min-[revision](-[classifier])-latest.[ext]";
private NamedDomainObjectContainer<OpenSearchDistribution> distributionsContainer;
private NamedDomainObjectContainer<DistributionResolution> distributionsResolutionStrategiesContainer;