diff --git a/distribution/packages/build.gradle b/distribution/packages/build.gradle index 1bd11dc2313b..1d0f77bd3597 100644 --- a/distribution/packages/build.gradle +++ b/distribution/packages/build.gradle @@ -42,10 +42,20 @@ import java.util.regex.Pattern * dpkg -c path/to/elasticsearch.deb */ -plugins { - id "com.netflix.nebula.ospackage-base" version "11.5.0" +buildscript { + repositories { + maven { + url 'https://jitpack.io' + } + mavenCentral() + } + dependencies { + classpath "com.github.breskeby:gradle-ospackage-plugin:2da19425133" + } } +apply plugin: "com.netflix.nebula.ospackage-base" + ['deb', 'rpm'].each { type -> String packagingFiles = "build/packaging/${type}" @@ -56,14 +66,14 @@ plugins { with copySpec { from 'src/common' from "src/${type}" - filter("tokens" : expansionsForDistribution(type, false), ReplaceTokens.class) + filter("tokens": expansionsForDistribution(type, false), ReplaceTokens.class) } into('etc/elasticsearch') { with configFiles(type, false) } - filter("tokens" : expansionsForDistribution(type, false), ReplaceTokens.class) + filter("tokens": expansionsForDistribution(type, false), ReplaceTokens.class) doLast { // create empty dirs, we set the permissions when configuring the packages @@ -92,22 +102,22 @@ def commonPackageConfig(String type, String architecture) { if (architecture == 'x64') { arch('amd64') } else { - assert architecture == 'aarch64' : architecture + assert architecture == 'aarch64': architecture arch('arm64') } } else { - assert type == 'rpm' : type + assert type == 'rpm': type if (architecture == 'x64') { arch('X86_64') } else { - assert architecture == 'aarch64' : architecture + assert architecture == 'aarch64': architecture arch('aarch64') } } // Follow elasticsearch's file naming convention String prefix = "${architecture == 'aarch64' ? 'aarch64-' : ''}${type}" destinationDirectory = file("${prefix}/build/distributions") - archiveFileName.value(project.provider({ "${packageName}-${project.version}-${archString}.${type}" } )) + archiveFileName.value(project.provider({ "${packageName}-${project.version}-${archString}.${type}" })) String packagingFiles = "build/packaging/${type}" String scripts = "${packagingFiles}/scripts" @@ -184,9 +194,9 @@ def commonPackageConfig(String type, String architecture) { configurationFile '/etc/elasticsearch/users_roles' from("${packagingFiles}") { dirMode 02750 - setgid = true into('/etc') permissionGroup 'elasticsearch' + setgid true includeEmptyDirs true createDirectoryEntry true include("elasticsearch") // empty dir, just to add directory entry @@ -243,7 +253,7 @@ def commonPackageConfig(String type, String architecture) { user u permissionGroup g dirMode = mode - setgid = mode == 02750 + setgid (mode == 02750) } } copyEmptyDir('/var/log/elasticsearch', 'elasticsearch', 'elasticsearch', 02750) @@ -402,7 +412,7 @@ subprojects { } else { assert project.name.contains('rpm') tasks.named("checkExtraction").configure { - onlyIf("rpm exists", rpmExists) + onlyIf("rpm exists", rpmExists) final File rpmDatabase = new File(extractionDir, 'rpm-database') commandLine 'rpm', '--badreloc', @@ -434,9 +444,11 @@ subprojects { copyrightPath = packageExtractionDir.toPath().resolve("usr/share/doc/elasticsearch/copyright") expectedLicense = "Elastic-License" licenseFilename = "ELASTIC-LICENSE-2.0.txt" - final List header = Arrays.asList("Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/", + final List header = Arrays.asList( + "Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/", "Copyright: Elasticsearch B.V. ", - "License: " + expectedLicense) + "License: " + expectedLicense + ) final List licenseLines = Files.readAllLines(rootDir.toPath().resolve("licenses/" + licenseFilename)) final List expectedLines = header + licenseLines.collect { " " + it } assertLinesInFile(copyrightPath, expectedLines) diff --git a/gradle/verification-metadata.xml b/gradle/verification-metadata.xml index 0bb0f1dbf2c4..8fcb2fecad97 100644 --- a/gradle/verification-metadata.xml +++ b/gradle/verification-metadata.xml @@ -36,6 +36,11 @@ + + + + + @@ -69,11 +74,11 @@ - - - - - + + + + + @@ -351,6 +356,11 @@ + + + + + @@ -2614,7 +2624,7 @@ - +