Remove no-jdk distributions (#76896)

This commit is contained in:
Mark Vieira 2021-08-25 09:52:15 -07:00 committed by GitHub
parent 5c00587edf
commit 8a9ea85657
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 72 additions and 224 deletions

View file

@ -364,38 +364,16 @@ public class DistroTestPlugin implements Plugin<Project> {
List<ElasticsearchDistribution> currentDistros = new ArrayList<>(); List<ElasticsearchDistribution> currentDistros = new ArrayList<>();
for (Architecture architecture : Architecture.values()) { for (Architecture architecture : Architecture.values()) {
ALL_INTERNAL.stream().forEach(type -> { ALL_INTERNAL.stream().forEach(type -> currentDistros.add(
for (boolean bundledJdk : Arrays.asList(true, false)) { createDistro(distributions, architecture, type, null, true, VersionProperties.getElasticsearch())
if (bundledJdk == false) { ));
// We'll never publish an ARM (aarch64) build without a bundled JDK.
if (architecture == Architecture.AARCH64) {
continue;
}
// All our Docker images include a bundled JDK so it doesn't make sense to test without one.
if (type.isDocker()) {
continue;
}
}
currentDistros.add(
createDistro(distributions, architecture, type, null, bundledJdk, VersionProperties.getElasticsearch())
);
}
});
} }
for (Architecture architecture : Architecture.values()) { for (Architecture architecture : Architecture.values()) {
for (Platform platform : Arrays.asList(Platform.LINUX, Platform.WINDOWS)) { for (Platform platform : Arrays.asList(Platform.LINUX, Platform.WINDOWS)) {
for (boolean bundledJdk : Arrays.asList(true, false)) { currentDistros.add(
if (bundledJdk == false && architecture != Architecture.X64) { createDistro(distributions, architecture, ARCHIVE, platform, true, VersionProperties.getElasticsearch())
// We will never publish distributions for non-x86 (amd64) platforms );
// without a bundled JDK
continue;
}
currentDistros.add(
createDistro(distributions, architecture, ARCHIVE, platform, bundledJdk, VersionProperties.getElasticsearch())
);
}
} }
} }

View file

@ -11,26 +11,26 @@ import java.nio.file.Path
apply plugin: 'elasticsearch.internal-distribution-archive-setup' apply plugin: 'elasticsearch.internal-distribution-archive-setup'
CopySpec archiveFiles(CopySpec modulesFiles, String distributionType, String platform, String architecture, boolean oss, boolean jdk) { CopySpec archiveFiles(CopySpec modulesFiles, String distributionType, String platform, String architecture, boolean isTestDistro) {
return copySpec { return copySpec {
into("elasticsearch-${version}") { into("elasticsearch-${version}") {
into('lib') { into('lib') {
with libFiles(oss) with libFiles(isTestDistro)
} }
into('config') { into('config') {
dirMode 0750 dirMode 0750
fileMode 0660 fileMode 0660
with configFiles(distributionType, oss, jdk) with configFiles(distributionType, isTestDistro)
from { from {
dirMode 0750 dirMode 0750
jvmOptionsDir.getParent() jvmOptionsDir.getParent()
} }
} }
into('bin') { into('bin') {
with binFiles(distributionType, oss, jdk) with binFiles(distributionType, isTestDistro)
} }
if (jdk) { into("darwin".equals(platform) ? 'jdk.app' : 'jdk') {
into("darwin".equals(platform) ? 'jdk.app' : 'jdk') { if (isTestDistro == false) {
with jdkFiles(project, platform, architecture) with jdkFiles(project, platform, architecture)
} }
} }
@ -50,11 +50,11 @@ CopySpec archiveFiles(CopySpec modulesFiles, String distributionType, String pla
include 'README.asciidoc' include 'README.asciidoc'
} }
from(rootProject.file('licenses')) { from(rootProject.file('licenses')) {
include oss ? 'SSPL-1.0+ELASTIC-LICENSE-2.0.txt' : 'ELASTIC-LICENSE-2.0.txt' include isTestDistro ? 'SSPL-1.0+ELASTIC-LICENSE-2.0.txt' : 'ELASTIC-LICENSE-2.0.txt'
rename { 'LICENSE.txt' } rename { 'LICENSE.txt' }
} }
with noticeFile(oss, jdk) with noticeFile(isTestDistro)
into('modules') { into('modules') {
with modulesFiles with modulesFiles
} }
@ -65,70 +65,42 @@ CopySpec archiveFiles(CopySpec modulesFiles, String distributionType, String pla
distribution_archives { distribution_archives {
integTestZip { integTestZip {
content { content {
archiveFiles(transportModulesFiles, 'zip', null, 'x64', true, false) archiveFiles(transportModulesFiles, 'zip', null, 'x64', true)
} }
} }
windowsZip { windowsZip {
archiveClassifier = 'windows-x86_64' archiveClassifier = 'windows-x86_64'
content { content {
archiveFiles(modulesFiles('windows-x86_64'), 'zip', 'windows', 'x64', false, true) archiveFiles(modulesFiles('windows-x86_64'), 'zip', 'windows', 'x64', false)
}
}
noJdkWindowsZip {
archiveClassifier = 'no-jdk-windows-x86_64'
content {
archiveFiles(modulesFiles('windows-x86_64'), 'zip', 'windows', 'x64', false, false)
} }
} }
darwinTar { darwinTar {
archiveClassifier = 'darwin-x86_64' archiveClassifier = 'darwin-x86_64'
content { content {
archiveFiles(modulesFiles('darwin-x86_64'), 'tar', 'darwin', 'x64', false, true) archiveFiles(modulesFiles('darwin-x86_64'), 'tar', 'darwin', 'x64', false)
} }
} }
darwinAarch64Tar { darwinAarch64Tar {
archiveClassifier = 'darwin-aarch64' archiveClassifier = 'darwin-aarch64'
content { content {
archiveFiles(modulesFiles('darwin-aarch64'), 'tar', 'darwin', 'aarch64', false, true) archiveFiles(modulesFiles('darwin-aarch64'), 'tar', 'darwin', 'aarch64', false)
}
}
noJdkDarwinTar {
archiveClassifier = 'no-jdk-darwin-x86_64'
content {
archiveFiles(modulesFiles('darwin-x86_64'), 'tar', 'darwin', 'x64', false, false)
}
}
noJdkDarwinAarch64Tar {
archiveClassifier = 'no-jdk-darwin-aarch64'
content {
archiveFiles(modulesFiles('darwin-aarch64'), 'tar', 'darwin', 'aarch64', false, false)
} }
} }
linuxAarch64Tar { linuxAarch64Tar {
archiveClassifier = 'linux-aarch64' archiveClassifier = 'linux-aarch64'
content { content {
archiveFiles(modulesFiles('linux-aarch64'), 'tar', 'linux', 'aarch64', false, true) archiveFiles(modulesFiles('linux-aarch64'), 'tar', 'linux', 'aarch64', false)
} }
} }
linuxTar { linuxTar {
archiveClassifier = 'linux-x86_64' archiveClassifier = 'linux-x86_64'
content { content {
archiveFiles(modulesFiles('linux-x86_64'), 'tar', 'linux', 'x64', false, true) archiveFiles(modulesFiles('linux-x86_64'), 'tar', 'linux', 'x64', false)
}
}
noJdkLinuxTar {
archiveClassifier = 'no-jdk-linux-x86_64'
content {
archiveFiles(modulesFiles('linux-x86_64'), 'tar', 'linux', 'x64', false, false)
} }
} }
} }

View file

@ -1,2 +0,0 @@
// This file is intentionally blank. All configuration of the
// distribution is done in the parent project.

View file

@ -1,2 +0,0 @@
// This file is intentionally blank. All configuration of the
// distribution is done in the parent project.

View file

@ -1,2 +0,0 @@
// This file is intentionally blank. All configuration of the
// distribution is done in the parent project.

View file

@ -1,2 +0,0 @@
// This file is intentionally blank. All configuration of the
// distribution is done in the parent project.

View file

@ -69,10 +69,6 @@ def buildDefaultNoticeTaskProvider = tasks.register("buildDefaultNotice", Notice
licensesDir new File(project(':distribution').projectDir, 'licenses') licensesDir new File(project(':distribution').projectDir, 'licenses')
} }
def buildDefaultNoJdkNoticeTaskProvider = tasks.register("buildDefaultNoJdkNotice", NoticeTask)
def buildOssNoJdkNoticeTaskProvider = tasks.register("buildOssNoJdkNotice", NoticeTask)
// The :server and :libs projects belong to all distributions // The :server and :libs projects belong to all distributions
tasks.withType(NoticeTask).configureEach { tasks.withType(NoticeTask).configureEach {
licensesDir project(':server').file('licenses') licensesDir project(':server').file('licenses')
@ -86,7 +82,6 @@ tasks.withType(NoticeTask).configureEach {
/***************************************************************************** /*****************************************************************************
* Modules * * Modules *
*****************************************************************************/ *****************************************************************************/
String ossOutputs = 'build/outputs/oss'
String defaultOutputs = 'build/outputs/default' String defaultOutputs = 'build/outputs/default'
String systemdOutputs = 'build/outputs/systemd' String systemdOutputs = 'build/outputs/systemd'
String transportOutputs = 'build/outputs/transport-only' String transportOutputs = 'build/outputs/transport-only'
@ -354,20 +349,20 @@ configure(subprojects.findAll { ['archives', 'packages'].contains(it.name) }) {
from buildTransportModulesTaskProvider from buildTransportModulesTaskProvider
} }
configFiles = { distributionType, testDistro, jdk -> configFiles = { distributionType, isTestDistro ->
copySpec { copySpec {
with copySpec { with copySpec {
// main config files, processed with distribution specific substitutions // main config files, processed with distribution specific substitutions
from '../src/config' from '../src/config'
exclude 'log4j2.properties' // this is handled separately below exclude 'log4j2.properties' // this is handled separately below
filter("tokens" : expansionsForDistribution(distributionType, testDistro, jdk), ReplaceTokens.class) filter("tokens" : expansionsForDistribution(distributionType, isTestDistro), ReplaceTokens.class)
} }
from buildDefaultLog4jConfigTaskProvider from buildDefaultLog4jConfigTaskProvider
from defaultConfigFiles from defaultConfigFiles
} }
} }
binFiles = { distributionType, testDistro, jdk -> binFiles = { distributionType, testDistro ->
copySpec { copySpec {
// non-windows files, for all distributions // non-windows files, for all distributions
with copySpec { with copySpec {
@ -375,7 +370,7 @@ configure(subprojects.findAll { ['archives', 'packages'].contains(it.name) }) {
exclude '*.exe' exclude '*.exe'
exclude '*.bat' exclude '*.bat'
eachFile { it.setMode(0755) } eachFile { it.setMode(0755) }
filter("tokens" : expansionsForDistribution(distributionType, testDistro, jdk), ReplaceTokens.class) filter("tokens" : expansionsForDistribution(distributionType, testDistro), ReplaceTokens.class)
} }
// windows files, only for zip // windows files, only for zip
if (distributionType == 'zip') { if (distributionType == 'zip') {
@ -383,7 +378,7 @@ configure(subprojects.findAll { ['archives', 'packages'].contains(it.name) }) {
from '../src/bin' from '../src/bin'
include '*.bat' include '*.bat'
filter(FixCrLfFilter, eol: FixCrLfFilter.CrLf.newInstance('crlf')) filter(FixCrLfFilter, eol: FixCrLfFilter.CrLf.newInstance('crlf'))
filter("tokens" : expansionsForDistribution(distributionType, testDistro, jdk), ReplaceTokens.class) filter("tokens" : expansionsForDistribution(distributionType, testDistro), ReplaceTokens.class)
} }
with copySpec { with copySpec {
from '../src/bin' from '../src/bin'
@ -403,16 +398,12 @@ configure(subprojects.findAll { ['archives', 'packages'].contains(it.name) }) {
} }
} }
noticeFile = { testDistro, jdk -> noticeFile = { testDistro ->
copySpec { copySpec {
if (testDistro) { if (testDistro) {
from buildServerNoticeTaskProvider from buildServerNoticeTaskProvider
} else { } else {
if (jdk) { from buildDefaultNoticeTaskProvider
from buildDefaultNoticeTaskProvider
} else {
from buildDefaultNoJdkNoticeTaskProvider
}
} }
} }
} }
@ -466,14 +457,14 @@ configure(subprojects.findAll { ['archives', 'packages'].contains(it.name) }) {
* </dl> * </dl>
*/ */
subprojects { subprojects {
ext.expansionsForDistribution = { distributionType, testDistro, jdk -> ext.expansionsForDistribution = { distributionType, isTestDistro ->
final String packagingPathData = "path.data: /var/lib/elasticsearch" final String packagingPathData = "path.data: /var/lib/elasticsearch"
final String pathLogs = "/var/log/elasticsearch" final String pathLogs = "/var/log/elasticsearch"
final String packagingPathLogs = "path.logs: ${pathLogs}" final String packagingPathLogs = "path.logs: ${pathLogs}"
final String packagingLoggc = "${pathLogs}/gc.log" final String packagingLoggc = "${pathLogs}/gc.log"
String licenseText String licenseText
if (testDistro) { if (isTestDistro) {
licenseText = rootProject.file('licenses/SSPL-1.0+ELASTIC-LICENSE-2.0.txt').getText('UTF-8') licenseText = rootProject.file('licenses/SSPL-1.0+ELASTIC-LICENSE-2.0.txt').getText('UTF-8')
} else { } else {
licenseText = rootProject.file('licenses/ELASTIC-LICENSE-2.0.txt').getText('UTF-8') licenseText = rootProject.file('licenses/ELASTIC-LICENSE-2.0.txt').getText('UTF-8')
@ -541,7 +532,7 @@ subprojects {
], ],
'es.distribution.flavor': [ 'es.distribution.flavor': [
'def': testDistro ? 'oss' : 'default' 'def': 'default'
], ],
'es.distribution.type': [ 'es.distribution.type': [
@ -552,11 +543,11 @@ subprojects {
], ],
'es.bundled_jdk': [ 'es.bundled_jdk': [
'def': jdk ? 'true' : 'false' 'def': 'true'
], ],
'license.name': [ 'license.name': [
'deb': testDistro ? 'ASL-2.0' : 'Elastic-License' 'deb': 'Elastic-License'
], ],
'license.text': [ 'license.text': [

View file

@ -46,24 +46,24 @@ plugins {
id "nebula.ospackage-base" version "8.6.1" id "nebula.ospackage-base" version "8.6.1"
} }
void addProcessFilesTask(String type, boolean oss, boolean jdk) { ['deb', 'rpm'].each { type ->
String packagingFiles = "build/packaging/${oss ? 'oss-' : ''}${jdk ? '' : 'no-jdk-'}${type}" String packagingFiles = "build/packaging/${type}"
String taskName = "process${oss ? 'Oss' : ''}${jdk ? '' : 'NoJdk'}${type.capitalize()}Files" String taskName = "process${type.capitalize()}Files"
tasks.register(taskName, Copy) { tasks.register(taskName, Copy) {
into packagingFiles into packagingFiles
with copySpec { with copySpec {
from 'src/common' from 'src/common'
from "src/${type}" from "src/${type}"
filter("tokens" : expansionsForDistribution(type, oss, jdk), ReplaceTokens.class) filter("tokens" : expansionsForDistribution(type, false), ReplaceTokens.class)
} }
into('etc/elasticsearch') { into('etc/elasticsearch') {
with configFiles(type, oss, jdk) with configFiles(type, false)
} }
filter("tokens" : expansionsForDistribution(type, oss, jdk), ReplaceTokens.class) filter("tokens" : expansionsForDistribution(type, false), ReplaceTokens.class)
doLast { doLast {
// create empty dirs, we set the permissions when configuring the packages // create empty dirs, we set the permissions when configuring the packages
@ -78,25 +78,16 @@ void addProcessFilesTask(String type, boolean oss, boolean jdk) {
} }
} }
addProcessFilesTask('deb', true, true)
addProcessFilesTask('deb', true, false)
addProcessFilesTask('deb', false, true)
addProcessFilesTask('deb', false, false)
addProcessFilesTask('rpm', true, true)
addProcessFilesTask('rpm', true, false)
addProcessFilesTask('rpm', false, true)
addProcessFilesTask('rpm', false, false)
// Common configuration that is package dependent. This can't go in ospackage // Common configuration that is package dependent. This can't go in ospackage
// since we have different templated files that need to be consumed, but the structure // since we have different templated files that need to be consumed, but the structure
// is the same // is the same
Closure commonPackageConfig(String type, boolean oss, boolean jdk, String architecture) { def commonPackageConfig(String type, String architecture) {
return { return {
onlyIf { onlyIf {
OS.current().equals(OS.WINDOWS) == false OS.current().equals(OS.WINDOWS) == false
} }
dependsOn "process${oss ? 'Oss' : ''}${jdk ? '' : 'NoJdk'}${type.capitalize()}Files" dependsOn "process${type.capitalize()}Files"
packageName "elasticsearch${oss ? '-oss' : ''}" packageName "elasticsearch"
if (type == 'deb') { if (type == 'deb') {
if (architecture == 'x64') { if (architecture == 'x64') {
arch('amd64') arch('amd64')
@ -114,11 +105,10 @@ Closure commonPackageConfig(String type, boolean oss, boolean jdk, String archit
} }
} }
// Follow elasticsearch's file naming convention // Follow elasticsearch's file naming convention
String jdkString = jdk ? "" : "no-jdk-" String prefix = "${architecture == 'aarch64' ? 'aarch64-' : ''}${type}"
String prefix = "${architecture == 'aarch64' ? 'aarch64-' : ''}${oss ? 'oss-' : ''}${jdk ? '' : 'no-jdk-'}${type}"
destinationDirectory = file("${prefix}/build/distributions") destinationDirectory = file("${prefix}/build/distributions")
archiveFileName.value(project.provider({ "${packageName}-${project.version}-${jdkString}${archString}.${type}" } )) archiveFileName.value(project.provider({ "${packageName}-${project.version}-${archString}.${type}" } ))
String packagingFiles = "build/packaging/${oss ? 'oss-' : ''}${jdk ? '' : 'no-jdk-'}${type}" String packagingFiles = "build/packaging/${type}"
String scripts = "${packagingFiles}/scripts" String scripts = "${packagingFiles}/scripts"
preInstall file("${scripts}/preinst") preInstall file("${scripts}/preinst")
@ -133,22 +123,20 @@ Closure commonPackageConfig(String type, boolean oss, boolean jdk, String archit
// specify it again explicitly for copying common files // specify it again explicitly for copying common files
into('/usr/share/elasticsearch') { into('/usr/share/elasticsearch') {
into('bin') { into('bin') {
with binFiles(type, oss, jdk) with binFiles(type, false)
} }
from(rootProject.projectDir) { from(rootProject.projectDir) {
include 'README.asciidoc' include 'README.asciidoc'
fileMode 0644 fileMode 0644
} }
into('lib') { into('lib') {
with libFiles(oss) with libFiles(false)
} }
into('modules') { into('modules') {
with modulesFiles('linux-' + ((architecture == 'x64') ? 'x86_64' : architecture)) with modulesFiles('linux-' + ((architecture == 'x64') ? 'x86_64' : architecture))
} }
if (jdk) { into('jdk') {
into('jdk') { with jdkFiles(project, 'linux', architecture)
with jdkFiles(project, 'linux', architecture)
}
} }
// we need to specify every intermediate directory in these paths so the package managers know they are explicitly // we need to specify every intermediate directory in these paths so the package managers know they are explicitly
// intended to manage them; otherwise they may be left behind on uninstallation. duplicate calls of the same // intended to manage them; otherwise they may be left behind on uninstallation. duplicate calls of the same
@ -178,7 +166,7 @@ Closure commonPackageConfig(String type, boolean oss, boolean jdk, String archit
assert type == 'rpm' assert type == 'rpm'
into('/usr/share/elasticsearch') { into('/usr/share/elasticsearch') {
from(rootProject.file('licenses')) { from(rootProject.file('licenses')) {
include oss ? 'SSPL-1.0+ELASTIC-LICENSE-2.0.txt' : 'ELASTIC-LICENSE-2.0.txt' include 'ELASTIC-LICENSE-2.0.txt'
rename { 'LICENSE.txt' } rename { 'LICENSE.txt' }
} }
fileMode 0644 fileMode 0644
@ -189,12 +177,10 @@ Closure commonPackageConfig(String type, boolean oss, boolean jdk, String archit
configurationFile '/etc/elasticsearch/elasticsearch.yml' configurationFile '/etc/elasticsearch/elasticsearch.yml'
configurationFile '/etc/elasticsearch/jvm.options' configurationFile '/etc/elasticsearch/jvm.options'
configurationFile '/etc/elasticsearch/log4j2.properties' configurationFile '/etc/elasticsearch/log4j2.properties'
if (oss == false) { configurationFile '/etc/elasticsearch/role_mapping.yml'
configurationFile '/etc/elasticsearch/role_mapping.yml' configurationFile '/etc/elasticsearch/roles.yml'
configurationFile '/etc/elasticsearch/roles.yml' configurationFile '/etc/elasticsearch/users'
configurationFile '/etc/elasticsearch/users' configurationFile '/etc/elasticsearch/users_roles'
configurationFile '/etc/elasticsearch/users_roles'
}
from("${packagingFiles}") { from("${packagingFiles}") {
dirMode 02750 dirMode 02750
into('/etc') into('/etc')
@ -213,7 +199,7 @@ Closure commonPackageConfig(String type, boolean oss, boolean jdk, String archit
createDirectoryEntry true createDirectoryEntry true
fileType CONFIG | NOREPLACE fileType CONFIG | NOREPLACE
} }
String envFile = expansionsForDistribution(type, oss, jdk)['path.env'] String envFile = expansionsForDistribution(type, false)['path.env']
configurationFile envFile configurationFile envFile
into(new File(envFile).getParent()) { into(new File(envFile).getParent()) {
fileType CONFIG | NOREPLACE fileType CONFIG | NOREPLACE
@ -261,10 +247,10 @@ Closure commonPackageConfig(String type, boolean oss, boolean jdk, String archit
copyEmptyDir('/usr/share/elasticsearch/plugins', 'root', 'root', 0755) copyEmptyDir('/usr/share/elasticsearch/plugins', 'root', 'root', 0755)
// the oss package conflicts with the default distribution and vice versa // the oss package conflicts with the default distribution and vice versa
conflicts('elasticsearch' + (oss ? '' : '-oss')) conflicts('elasticsearch-oss')
into '/usr/share/elasticsearch' into '/usr/share/elasticsearch'
with noticeFile(oss, jdk) with noticeFile(false)
} }
} }
@ -300,17 +286,13 @@ ospackage {
into '/usr/share/elasticsearch' into '/usr/share/elasticsearch'
} }
Closure commonDebConfig(boolean oss, boolean jdk, String architecture) { Closure commonDebConfig(String architecture) {
return { return {
configure(commonPackageConfig('deb', oss, jdk, architecture)) configure(commonPackageConfig('deb', architecture))
// jdeb does not provide a way to set the License control attribute, and ospackage // jdeb does not provide a way to set the License control attribute, and ospackage
// silently ignores setting it. Instead, we set the license as "custom field" // silently ignores setting it. Instead, we set the license as "custom field"
if (oss) { customFields['License'] = 'Elastic-License'
customFields['License'] = 'ASL-2.0'
} else {
customFields['License'] = 'Elastic-License'
}
archiveVersion = project.version.replace('-', '~') archiveVersion = project.version.replace('-', '~')
packageGroup 'web' packageGroup 'web'
@ -323,46 +305,23 @@ Closure commonDebConfig(boolean oss, boolean jdk, String architecture) {
into('/usr/share/lintian/overrides') { into('/usr/share/lintian/overrides') {
from('src/deb/lintian/elasticsearch') from('src/deb/lintian/elasticsearch')
if (oss) {
rename('elasticsearch', 'elasticsearch-oss')
}
} }
} }
} }
tasks.register('buildAarch64Deb', Deb) { tasks.register('buildAarch64Deb', Deb) {
configure(commonDebConfig(false, true, 'aarch64')) configure(commonDebConfig('aarch64'))
} }
tasks.register('buildDeb', Deb) { tasks.register('buildDeb', Deb) {
configure(commonDebConfig(false, true, 'x64')) configure(commonDebConfig('x64'))
} }
tasks.register('buildAarch64OssDeb', Deb) { Closure commonRpmConfig(String architecture) {
configure(commonDebConfig(true, true, 'aarch64'))
}
tasks.register('buildOssDeb', Deb) {
configure(commonDebConfig(true, true, 'x64'))
}
tasks.register('buildNoJdkDeb', Deb) {
configure(commonDebConfig(false, false, 'x64'))
}
tasks.register('buildOssNoJdkDeb', Deb) {
configure(commonDebConfig(true, false, 'x64'))
}
Closure commonRpmConfig(boolean oss, boolean jdk, String architecture) {
return { return {
configure(commonPackageConfig('rpm', oss, jdk, architecture)) configure(commonPackageConfig('rpm', architecture))
if (oss) { license 'Elastic License'
license 'ASL 2.0'
} else {
license 'Elastic License'
}
packageGroup 'Application/Internet' packageGroup 'Application/Internet'
requires '/bin/bash' requires '/bin/bash'
@ -384,27 +343,11 @@ Closure commonRpmConfig(boolean oss, boolean jdk, String architecture) {
} }
tasks.register('buildAarch64Rpm', Rpm) { tasks.register('buildAarch64Rpm', Rpm) {
configure(commonRpmConfig(false, true, 'aarch64')) configure(commonRpmConfig('aarch64'))
} }
tasks.register('buildRpm', Rpm) { tasks.register('buildRpm', Rpm) {
configure(commonRpmConfig(false, true, 'x64')) configure(commonRpmConfig('x64'))
}
tasks.register('buildAarch64OssRpm', Rpm) {
configure(commonRpmConfig(true, true, 'aarch64'))
}
tasks.register('buildOssRpm', Rpm) {
configure(commonRpmConfig(true, true, 'x64'))
}
tasks.register('buildNoJdkRpm', Rpm) {
configure(commonRpmConfig(false, false, 'x64'))
}
tasks.register('buildOssNoJdkRpm', Rpm) {
configure(commonRpmConfig(true, false, 'x64'))
} }
Closure dpkgExists = { it -> new File('/bin/dpkg-deb').exists() || new File('/usr/bin/dpkg-deb').exists() || new File('/usr/local/bin/dpkg-deb').exists() } Closure dpkgExists = { it -> new File('/bin/dpkg-deb').exists() || new File('/usr/bin/dpkg-deb').exists() || new File('/usr/local/bin/dpkg-deb').exists() }
@ -481,15 +424,9 @@ subprojects {
Path copyrightPath Path copyrightPath
String expectedLicense String expectedLicense
String licenseFilename String licenseFilename
if (project.name.contains('oss-')) { copyrightPath = packageExtractionDir.toPath().resolve("usr/share/doc/elasticsearch/copyright")
copyrightPath = packageExtractionDir.toPath().resolve("usr/share/doc/elasticsearch-oss/copyright") expectedLicense = "Elastic-License"
expectedLicense = "ASL-2.0" licenseFilename = "ELASTIC-LICENSE-2.0.txt"
licenseFilename = "SSPL-1.0+ELASTIC-LICENSE-2.0.txt"
} else {
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>", "Copyright: Elasticsearch B.V. <info@elastic.co>",
"License: " + expectedLicense) "License: " + expectedLicense)
@ -504,11 +441,7 @@ subprojects {
onlyIf rpmExists onlyIf rpmExists
doLast { doLast {
String licenseFilename String licenseFilename
if (project.name.contains('oss-')) { licenseFilename = "ELASTIC-LICENSE-2.0.txt"
licenseFilename = "SSPL-1.0+ELASTIC-LICENSE-2.0.txt"
} else {
licenseFilename = "ELASTIC-LICENSE-2.0.txt"
}
final List<String> licenseLines = Files.readAllLines(rootDir.toPath().resolve("licenses/" + licenseFilename)) final List<String> licenseLines = Files.readAllLines(rootDir.toPath().resolve("licenses/" + licenseFilename))
final Path licensePath = packageExtractionDir.toPath().resolve("usr/share/elasticsearch/LICENSE.txt") final Path licensePath = packageExtractionDir.toPath().resolve("usr/share/elasticsearch/LICENSE.txt")
assertLinesInFile(licensePath, licenseLines) assertLinesInFile(licensePath, licenseLines)
@ -544,11 +477,7 @@ subprojects {
exec.standardOutput = output exec.standardOutput = output
doLast { doLast {
String expectedLicense String expectedLicense
if (project.name.contains('oss-')) { expectedLicense = "Elastic-License"
expectedLicense = "ASL-2.0"
} else {
expectedLicense = "Elastic-License"
}
final Pattern pattern = Pattern.compile("\\s*License: (.+)") final Pattern pattern = Pattern.compile("\\s*License: (.+)")
final String info = output.toString('UTF-8') final String info = output.toString('UTF-8')
final String[] actualLines = info.split("\n") final String[] actualLines = info.split("\n")
@ -581,11 +510,7 @@ subprojects {
doLast { doLast {
String license = output.toString('UTF-8') String license = output.toString('UTF-8')
String expectedLicense String expectedLicense
if (project.name.contains('oss-')) { expectedLicense = "Elastic License"
expectedLicense = "ASL 2.0"
} else {
expectedLicense = "Elastic License"
}
if (license != expectedLicense) { if (license != expectedLicense) {
throw new GradleException("expected license [${expectedLicense}] for [${-> buildDist.get().outputs.files.singleFile}] but was [${license}]") throw new GradleException("expected license [${expectedLicense}] for [${-> buildDist.get().outputs.files.singleFile}] but was [${license}]")
} }

View file

@ -1,2 +0,0 @@
// This file is intentionally blank. All configuration of the
// distribution is done in the parent project.

View file

@ -1,2 +0,0 @@
// This file is intentionally blank. All configuration of the
// distribution is done in the parent project.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

View file

@ -22,14 +22,10 @@ List projects = [
'benchmarks', 'benchmarks',
'distribution:archives:integ-test-zip', 'distribution:archives:integ-test-zip',
'distribution:archives:windows-zip', 'distribution:archives:windows-zip',
'distribution:archives:no-jdk-windows-zip',
'distribution:archives:darwin-tar', 'distribution:archives:darwin-tar',
'distribution:archives:darwin-aarch64-tar', 'distribution:archives:darwin-aarch64-tar',
'distribution:archives:no-jdk-darwin-tar',
'distribution:archives:no-jdk-darwin-aarch64-tar',
'distribution:archives:linux-aarch64-tar', 'distribution:archives:linux-aarch64-tar',
'distribution:archives:linux-tar', 'distribution:archives:linux-tar',
'distribution:archives:no-jdk-linux-tar',
'distribution:docker', 'distribution:docker',
'distribution:docker:cloud-docker-export', 'distribution:docker:cloud-docker-export',
'distribution:docker:cloud-docker-aarch64-export', 'distribution:docker:cloud-docker-aarch64-export',
@ -43,10 +39,8 @@ List projects = [
'distribution:docker:ubi-docker-export', 'distribution:docker:ubi-docker-export',
'distribution:packages:aarch64-deb', 'distribution:packages:aarch64-deb',
'distribution:packages:deb', 'distribution:packages:deb',
'distribution:packages:no-jdk-deb',
'distribution:packages:aarch64-rpm', 'distribution:packages:aarch64-rpm',
'distribution:packages:rpm', 'distribution:packages:rpm',
'distribution:packages:no-jdk-rpm',
'distribution:bwc:bugfix', 'distribution:bwc:bugfix',
'distribution:bwc:maintenance', 'distribution:bwc:maintenance',
'distribution:bwc:minor', 'distribution:bwc:minor',