Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
security:logging
logstash
0008-drop-ES-download.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0008-drop-ES-download.patch of Package logstash
From 7c3ed504978b646692859c2ec241f8ea60f7aebe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Klaus=20K=C3=A4mpf?= <kkaempf@suse.de> Date: Mon, 20 Jul 2020 19:07:39 +0200 Subject: [PATCH 8/8] drop ES download --- build.gradle | 103 --------------------------------------------------- 1 file changed, 103 deletions(-) diff --git a/build.gradle b/build.gradle index 6ef76ba7bad6..98c9c55ed29d 100644 --- a/build.gradle +++ b/build.gradle @@ -346,106 +346,3 @@ bootstrap.dependsOn assemblyDeps runIntegrationTests.shouldRunAfter tasks.getByPath(":logstash-core:test") check.dependsOn runIntegrationTests - -String artifactsVersionApi = "https://artifacts-api.elastic.co/v1/versions/" - -task downloadEs(type: Download) { - description "Download ES Snapshot for current branch version: ${version}" - - doFirst { - if (!project.ext.versionFound) { - throw new GradleException("could not find the current artifact from the artifact-api ${artifactsVersionApi} for " + (isReleaseBuild ? "release" : "snapshot") + " version: ${version}") - } - } - - String apiResponse = artifactsVersionApi.toURL().text - def dlVersions = new JsonSlurper().parseText(apiResponse) - // the version string can be either '7.0.0' or '7.0.0-alpha1', i.e. with the qualifier. - // in the normal PR type builds it is plain '7.0.0' - // in the build invoked by the release manager it is '7.0.0-alpha1' etc. - // the artifacts-api will return JSON like this: `{"versions":["5.6.13-SNAPSHOT","6.4.3-SNAPSHOT","6.5.0-SNAPSHOT","6.6.0-SNAPSHOT","7.0.0-alpha1-SNAPSHOT"]}` - - String qualifiedVersion = dlVersions['versions'].grep(isReleaseBuild ? ~/^${version}$/ : ~/^${version}-SNAPSHOT/)[0] - - if (qualifiedVersion == null) { - // the version is not found in the versions API, for now just set dummy values so the - // task parameters like src and dest below sees these dummy values but also set - // versionFound to false so that we can fail the task in the doFirst closure. - // this is somewhat convoluted and there is certainly a better way to do this but - // it seems to be an acceptable solution for now. - project.ext.set("versionFound", false) - project.ext.set("elasticsearchSnapshotURL", "http://elastic.co/invalid") - project.ext.set("elasticsearchDownloadLocation", "${projectDir}/build/invalid") - } else { - project.ext.set("versionFound", true) - - String arch = "x86_64" - String osName = System.properties['os.name'] - - if (osName ==~ /Mac OS X/) { - osName = "darwin" - } else { - osName = "linux" - } - - String architecture = "${osName}-${arch}" - - String downloadedElasticsearchName = "elasticsearch-${qualifiedVersion}-${architecture}" - project.ext.set("unpackedElasticsearchName", "elasticsearch-${qualifiedVersion}") - - // find latest reference to last build - String buildsListApi = "https://artifacts-api.elastic.co/v1/versions/${qualifiedVersion}/builds/" - apiResponse = buildsListApi.toURL().text - def dlBuilds = new JsonSlurper().parseText(apiResponse) - String build = dlBuilds["builds"][0] - - // find url of build artifact - String artifactApiUrl = "https://artifacts-api.elastic.co/v1/versions/${qualifiedVersion}/builds/${build}/projects/elasticsearch/packages/${downloadedElasticsearchName}.tar.gz" - apiResponse = artifactApiUrl.toURL().text - def buildUrls = new JsonSlurper().parseText(apiResponse) - - project.ext.set("elasticsearchSnapshotURL", System.getenv("ELASTICSEARCH_SNAPSHOT_URL") ?: buildUrls["package"]["url"]) - project.ext.set("elasticsearchDownloadLocation", "${projectDir}/build/${downloadedElasticsearchName}.tar.gz") - } - - src project.ext.elasticsearchSnapshotURL - onlyIfNewer true - inputs.file("${projectDir}/versions.yml") - outputs.file(project.ext.elasticsearchDownloadLocation) - dest new File(project.ext.elasticsearchDownloadLocation) - - doLast { - System.out.println "Downloaded to ${project.ext.elasticsearchDownloadLocation}" - } -} - -task deleteLocalEs(type: Delete) { - delete ('./build/elasticsearch') -} - -task copyEs(type: Copy, dependsOn: [downloadEs, deleteLocalEs]) { - from tarTree(resources.gzip(project.ext.elasticsearchDownloadLocation)) - into "./build/" - doLast { - file("./build/${project.ext.unpackedElasticsearchName}").renameTo('./build/elasticsearch') - System.out.println "Unzipped ${project.ext.elasticsearchDownloadLocation} to ./build/elasticsearch" - } -} - -Boolean oss = System.getenv('OSS').equals('true') - -if (!oss) { - project(":logstash-xpack") { - ["rubyTests", "rubyIntegrationTests", "test"].each { tsk -> - tasks.getByPath(":logstash-xpack:" + tsk).configure { - dependsOn installTestGems - } - } - tasks.getByPath(":logstash-xpack:rubyIntegrationTests").configure { - dependsOn copyEs - } - } - - task runXPackUnitTests(dependsOn: [tasks.getByPath(":logstash-xpack:rubyTests")]) {} - task runXPackIntegrationTests(dependsOn: [tasks.getByPath(":logstash-xpack:rubyIntegrationTests")]) {} -} -- 2.26.0
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor