mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-04-24 23:27:25 -04:00
Use no-kpi subdomains for tests downloading artifacts (#64502)
This commit converts build code that downloads distributions or other artifacts to use the new no-kpi subdomain, and removes the formerly used no-kpi header.
This commit is contained in:
parent
cfe43b731d
commit
2fffd78125
4 changed files with 6 additions and 14 deletions
|
@ -34,10 +34,8 @@ import org.gradle.api.artifacts.Configuration;
|
||||||
import org.gradle.api.artifacts.dsl.DependencyHandler;
|
import org.gradle.api.artifacts.dsl.DependencyHandler;
|
||||||
import org.gradle.api.artifacts.repositories.IvyArtifactRepository;
|
import org.gradle.api.artifacts.repositories.IvyArtifactRepository;
|
||||||
import org.gradle.api.artifacts.type.ArtifactTypeDefinition;
|
import org.gradle.api.artifacts.type.ArtifactTypeDefinition;
|
||||||
import org.gradle.api.credentials.HttpHeaderCredentials;
|
|
||||||
import org.gradle.api.internal.artifacts.ArtifactAttributes;
|
import org.gradle.api.internal.artifacts.ArtifactAttributes;
|
||||||
import org.gradle.api.provider.Provider;
|
import org.gradle.api.provider.Provider;
|
||||||
import org.gradle.authentication.http.HttpHeaderAuthentication;
|
|
||||||
|
|
||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
|
|
||||||
|
@ -146,12 +144,6 @@ public class DistributionDownloadPlugin implements Plugin<Project> {
|
||||||
repo.setName(name);
|
repo.setName(name);
|
||||||
repo.setUrl(url);
|
repo.setUrl(url);
|
||||||
repo.metadataSources(IvyArtifactRepository.MetadataSources::artifact);
|
repo.metadataSources(IvyArtifactRepository.MetadataSources::artifact);
|
||||||
// this header is not a credential but we hack the capability to send this header to avoid polluting our download stats
|
|
||||||
repo.credentials(HttpHeaderCredentials.class, creds -> {
|
|
||||||
creds.setName("X-Elastic-No-KPI");
|
|
||||||
creds.setValue("1");
|
|
||||||
});
|
|
||||||
repo.getAuthentication().create("header", HttpHeaderAuthentication.class);
|
|
||||||
repo.patternLayout(layout -> layout.artifact("/downloads/elasticsearch/[module]-[revision](-[classifier]).[ext]"));
|
repo.patternLayout(layout -> layout.artifact("/downloads/elasticsearch/[module]-[revision](-[classifier]).[ext]"));
|
||||||
});
|
});
|
||||||
project.getRepositories().exclusiveContent(exclusiveContentRepository -> {
|
project.getRepositories().exclusiveContent(exclusiveContentRepository -> {
|
||||||
|
@ -164,8 +156,8 @@ public class DistributionDownloadPlugin implements Plugin<Project> {
|
||||||
if (project.getRepositories().findByName(DOWNLOAD_REPO_NAME) != null) {
|
if (project.getRepositories().findByName(DOWNLOAD_REPO_NAME) != null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
addIvyRepo(project, DOWNLOAD_REPO_NAME, "https://artifacts.elastic.co", FAKE_IVY_GROUP);
|
addIvyRepo(project, DOWNLOAD_REPO_NAME, "https://artifacts-no-kpi.elastic.co", FAKE_IVY_GROUP);
|
||||||
addIvyRepo(project, SNAPSHOT_REPO_NAME, "https://snapshots.elastic.co", FAKE_SNAPSHOT_IVY_GROUP);
|
addIvyRepo(project, SNAPSHOT_REPO_NAME, "https://snapshots-no-kpi.elastic.co", FAKE_SNAPSHOT_IVY_GROUP);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -22,8 +22,8 @@ pushd ${work} >> /dev/null
|
||||||
echo Working in ${work}
|
echo Working in ${work}
|
||||||
|
|
||||||
wget https://download.elasticsearch.org/elasticsearch/release/org/elasticsearch/distribution/tar/elasticsearch/2.0.0/elasticsearch-2.0.0.tar.gz
|
wget https://download.elasticsearch.org/elasticsearch/release/org/elasticsearch/distribution/tar/elasticsearch/2.0.0/elasticsearch-2.0.0.tar.gz
|
||||||
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.0.0.tar.gz
|
wget https://artifacts-no-kpi.elastic.co/downloads/elasticsearch/elasticsearch-5.0.0.tar.gz
|
||||||
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.0.0.tar.gz
|
wget https://artifacts-no-kpi.elastic.co/downloads/elasticsearch/elasticsearch-6.0.0.tar.gz
|
||||||
sha1sum -c - << __SHAs
|
sha1sum -c - << __SHAs
|
||||||
e369d8579bd3a2e8b5344278d5043f19f14cac88 elasticsearch-2.0.0.tar.gz
|
e369d8579bd3a2e8b5344278d5043f19f14cac88 elasticsearch-2.0.0.tar.gz
|
||||||
d25f6547bccec9f0b5ea7583815f96a6f50849e0 elasticsearch-5.0.0.tar.gz
|
d25f6547bccec9f0b5ea7583815f96a6f50849e0 elasticsearch-5.0.0.tar.gz
|
||||||
|
|
|
@ -57,7 +57,7 @@ ext.expansions = { Architecture architecture, boolean oss, DockerBase base, bool
|
||||||
sourceElasticsearch = """
|
sourceElasticsearch = """
|
||||||
RUN curl --retry 8 -S -L \\
|
RUN curl --retry 8 -S -L \\
|
||||||
--output /opt/elasticsearch.tar.gz \\
|
--output /opt/elasticsearch.tar.gz \\
|
||||||
https://artifacts.elastic.co/downloads/elasticsearch/$elasticsearch
|
https://artifacts-no-kpi.elastic.co/downloads/elasticsearch/$elasticsearch
|
||||||
""".trim()
|
""".trim()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,7 @@ subprojects {
|
||||||
repositories {
|
repositories {
|
||||||
maven {
|
maven {
|
||||||
// Repository for downloading BWC compatible JDBC driver releases
|
// Repository for downloading BWC compatible JDBC driver releases
|
||||||
url = 'https://artifacts.elastic.co/maven'
|
url = 'https://artifacts-no-kpi.elastic.co/maven'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue