mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-04-25 07:37:19 -04:00
Use patched nebula os package gradle plugin (#100280)
There is a bug in the nebula os package gradle plugin that breaks copy spec specific setgid handling. We have created a patch for the plugin that we use for now to unblock us. This will be ported upstream to the nebula main branch and part of a release but that requires some more polishing and will be taken care of in a later PR
This commit is contained in:
parent
9f72ce0278
commit
d214d74000
2 changed files with 41 additions and 19 deletions
|
@ -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)
|
||||
|
@ -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<String> header = Arrays.asList("Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/",
|
||||
final List<String> header = Arrays.asList(
|
||||
"Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/",
|
||||
"Copyright: Elasticsearch B.V. <info@elastic.co>",
|
||||
"License: " + expectedLicense)
|
||||
"License: " + expectedLicense
|
||||
)
|
||||
final List<String> licenseLines = Files.readAllLines(rootDir.toPath().resolve("licenses/" + licenseFilename))
|
||||
final List<String> expectedLines = header + licenseLines.collect { " " + it }
|
||||
assertLinesInFile(copyrightPath, expectedLines)
|
||||
|
|
|
@ -36,6 +36,11 @@
|
|||
<sha256 value="d083479ca927dce2f586f779373d895e8bf668c632505740279390384edf03fa" origin="Generated by Gradle"/>
|
||||
</artifact>
|
||||
</component>
|
||||
<component group="com.github.breskeby" name="gradle-ospackage-plugin" version="2da19425133">
|
||||
<artifact name="gradle-ospackage-plugin-2da19425133.jar">
|
||||
<sha256 value="452e01bc961259e2a0f5d6f193a03cc8d29f560a433f7c8066158c97d3327af9" origin="Generated by Gradle"/>
|
||||
</artifact>
|
||||
</component>
|
||||
<component group="adoptium_8" name="linux" version="8u302">
|
||||
<artifact name="linux-8u302-aarch64.tar.gz">
|
||||
<sha256 value="f287cdc2a688c2df247ea0d8bfe2863645b73848e4e5c35b02a8a3d2d6b69551" origin="Generated by Gradle"/>
|
||||
|
@ -351,6 +356,11 @@
|
|||
<sha256 value="d6eb9f2f40049a7a808baf11ffba0737648e62ff52fde9271d808e5d57a27279" origin="Generated by Gradle"/>
|
||||
</artifact>
|
||||
</component>
|
||||
<component group="com.github.breskeby" name="gradle-ospackage-plugin" version="2da19425133">
|
||||
<artifact name="gradle-ospackage-plugin-2da19425133.jar">
|
||||
<sha256 value="452e01bc961259e2a0f5d6f193a03cc8d29f560a433f7c8066158c97d3327af9" origin="Generated by Gradle"/>
|
||||
</artifact>
|
||||
</component>
|
||||
<component group="com.github.javaparser" name="javaparser-core" version="3.18.0">
|
||||
<artifact name="javaparser-core-3.18.0.jar">
|
||||
<sha256 value="df7e2d5b8319efd51d015ab5071a271f8463158bc2f0979d05393fe028d856a0" origin="Generated by Gradle"/>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue