mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-04-24 23:27:25 -04:00
Remove no-jdk distributions (#76896)
This commit is contained in:
parent
5c00587edf
commit
8a9ea85657
12 changed files with 72 additions and 224 deletions
|
@ -364,38 +364,16 @@ public class DistroTestPlugin implements Plugin<Project> {
|
|||
List<ElasticsearchDistribution> currentDistros = new ArrayList<>();
|
||||
|
||||
for (Architecture architecture : Architecture.values()) {
|
||||
ALL_INTERNAL.stream().forEach(type -> {
|
||||
for (boolean bundledJdk : Arrays.asList(true, false)) {
|
||||
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())
|
||||
);
|
||||
}
|
||||
});
|
||||
ALL_INTERNAL.stream().forEach(type -> currentDistros.add(
|
||||
createDistro(distributions, architecture, type, null, true, VersionProperties.getElasticsearch())
|
||||
));
|
||||
}
|
||||
|
||||
for (Architecture architecture : Architecture.values()) {
|
||||
for (Platform platform : Arrays.asList(Platform.LINUX, Platform.WINDOWS)) {
|
||||
for (boolean bundledJdk : Arrays.asList(true, false)) {
|
||||
if (bundledJdk == false && architecture != Architecture.X64) {
|
||||
// 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())
|
||||
);
|
||||
}
|
||||
currentDistros.add(
|
||||
createDistro(distributions, architecture, ARCHIVE, platform, true, VersionProperties.getElasticsearch())
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -11,26 +11,26 @@ import java.nio.file.Path
|
|||
|
||||
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 {
|
||||
into("elasticsearch-${version}") {
|
||||
into('lib') {
|
||||
with libFiles(oss)
|
||||
with libFiles(isTestDistro)
|
||||
}
|
||||
into('config') {
|
||||
dirMode 0750
|
||||
fileMode 0660
|
||||
with configFiles(distributionType, oss, jdk)
|
||||
with configFiles(distributionType, isTestDistro)
|
||||
from {
|
||||
dirMode 0750
|
||||
jvmOptionsDir.getParent()
|
||||
}
|
||||
}
|
||||
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)
|
||||
}
|
||||
}
|
||||
|
@ -50,11 +50,11 @@ CopySpec archiveFiles(CopySpec modulesFiles, String distributionType, String pla
|
|||
include 'README.asciidoc'
|
||||
}
|
||||
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' }
|
||||
}
|
||||
|
||||
with noticeFile(oss, jdk)
|
||||
with noticeFile(isTestDistro)
|
||||
into('modules') {
|
||||
with modulesFiles
|
||||
}
|
||||
|
@ -65,70 +65,42 @@ CopySpec archiveFiles(CopySpec modulesFiles, String distributionType, String pla
|
|||
distribution_archives {
|
||||
integTestZip {
|
||||
content {
|
||||
archiveFiles(transportModulesFiles, 'zip', null, 'x64', true, false)
|
||||
archiveFiles(transportModulesFiles, 'zip', null, 'x64', true)
|
||||
}
|
||||
}
|
||||
|
||||
windowsZip {
|
||||
archiveClassifier = 'windows-x86_64'
|
||||
content {
|
||||
archiveFiles(modulesFiles('windows-x86_64'), 'zip', 'windows', 'x64', false, true)
|
||||
}
|
||||
}
|
||||
|
||||
noJdkWindowsZip {
|
||||
archiveClassifier = 'no-jdk-windows-x86_64'
|
||||
content {
|
||||
archiveFiles(modulesFiles('windows-x86_64'), 'zip', 'windows', 'x64', false, false)
|
||||
archiveFiles(modulesFiles('windows-x86_64'), 'zip', 'windows', 'x64', false)
|
||||
}
|
||||
}
|
||||
|
||||
darwinTar {
|
||||
archiveClassifier = 'darwin-x86_64'
|
||||
content {
|
||||
archiveFiles(modulesFiles('darwin-x86_64'), 'tar', 'darwin', 'x64', false, true)
|
||||
archiveFiles(modulesFiles('darwin-x86_64'), 'tar', 'darwin', 'x64', false)
|
||||
}
|
||||
}
|
||||
|
||||
darwinAarch64Tar {
|
||||
archiveClassifier = 'darwin-aarch64'
|
||||
content {
|
||||
archiveFiles(modulesFiles('darwin-aarch64'), 'tar', 'darwin', 'aarch64', false, true)
|
||||
}
|
||||
}
|
||||
|
||||
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)
|
||||
archiveFiles(modulesFiles('darwin-aarch64'), 'tar', 'darwin', 'aarch64', false)
|
||||
}
|
||||
}
|
||||
|
||||
linuxAarch64Tar {
|
||||
archiveClassifier = 'linux-aarch64'
|
||||
content {
|
||||
archiveFiles(modulesFiles('linux-aarch64'), 'tar', 'linux', 'aarch64', false, true)
|
||||
archiveFiles(modulesFiles('linux-aarch64'), 'tar', 'linux', 'aarch64', false)
|
||||
}
|
||||
}
|
||||
|
||||
linuxTar {
|
||||
archiveClassifier = 'linux-x86_64'
|
||||
content {
|
||||
archiveFiles(modulesFiles('linux-x86_64'), 'tar', 'linux', 'x64', false, true)
|
||||
}
|
||||
}
|
||||
|
||||
noJdkLinuxTar {
|
||||
archiveClassifier = 'no-jdk-linux-x86_64'
|
||||
content {
|
||||
archiveFiles(modulesFiles('linux-x86_64'), 'tar', 'linux', 'x64', false, false)
|
||||
archiveFiles(modulesFiles('linux-x86_64'), 'tar', 'linux', 'x64', false)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,2 +0,0 @@
|
|||
// This file is intentionally blank. All configuration of the
|
||||
// distribution is done in the parent project.
|
|
@ -1,2 +0,0 @@
|
|||
// This file is intentionally blank. All configuration of the
|
||||
// distribution is done in the parent project.
|
|
@ -1,2 +0,0 @@
|
|||
// This file is intentionally blank. All configuration of the
|
||||
// distribution is done in the parent project.
|
|
@ -1,2 +0,0 @@
|
|||
// This file is intentionally blank. All configuration of the
|
||||
// distribution is done in the parent project.
|
|
@ -69,10 +69,6 @@ def buildDefaultNoticeTaskProvider = tasks.register("buildDefaultNotice", Notice
|
|||
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
|
||||
tasks.withType(NoticeTask).configureEach {
|
||||
licensesDir project(':server').file('licenses')
|
||||
|
@ -86,7 +82,6 @@ tasks.withType(NoticeTask).configureEach {
|
|||
/*****************************************************************************
|
||||
* Modules *
|
||||
*****************************************************************************/
|
||||
String ossOutputs = 'build/outputs/oss'
|
||||
String defaultOutputs = 'build/outputs/default'
|
||||
String systemdOutputs = 'build/outputs/systemd'
|
||||
String transportOutputs = 'build/outputs/transport-only'
|
||||
|
@ -354,20 +349,20 @@ configure(subprojects.findAll { ['archives', 'packages'].contains(it.name) }) {
|
|||
from buildTransportModulesTaskProvider
|
||||
}
|
||||
|
||||
configFiles = { distributionType, testDistro, jdk ->
|
||||
configFiles = { distributionType, isTestDistro ->
|
||||
copySpec {
|
||||
with copySpec {
|
||||
// main config files, processed with distribution specific substitutions
|
||||
from '../src/config'
|
||||
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 defaultConfigFiles
|
||||
}
|
||||
}
|
||||
|
||||
binFiles = { distributionType, testDistro, jdk ->
|
||||
binFiles = { distributionType, testDistro ->
|
||||
copySpec {
|
||||
// non-windows files, for all distributions
|
||||
with copySpec {
|
||||
|
@ -375,7 +370,7 @@ configure(subprojects.findAll { ['archives', 'packages'].contains(it.name) }) {
|
|||
exclude '*.exe'
|
||||
exclude '*.bat'
|
||||
eachFile { it.setMode(0755) }
|
||||
filter("tokens" : expansionsForDistribution(distributionType, testDistro, jdk), ReplaceTokens.class)
|
||||
filter("tokens" : expansionsForDistribution(distributionType, testDistro), ReplaceTokens.class)
|
||||
}
|
||||
// windows files, only for zip
|
||||
if (distributionType == 'zip') {
|
||||
|
@ -383,7 +378,7 @@ configure(subprojects.findAll { ['archives', 'packages'].contains(it.name) }) {
|
|||
from '../src/bin'
|
||||
include '*.bat'
|
||||
filter(FixCrLfFilter, eol: FixCrLfFilter.CrLf.newInstance('crlf'))
|
||||
filter("tokens" : expansionsForDistribution(distributionType, testDistro, jdk), ReplaceTokens.class)
|
||||
filter("tokens" : expansionsForDistribution(distributionType, testDistro), ReplaceTokens.class)
|
||||
}
|
||||
with copySpec {
|
||||
from '../src/bin'
|
||||
|
@ -403,16 +398,12 @@ configure(subprojects.findAll { ['archives', 'packages'].contains(it.name) }) {
|
|||
}
|
||||
}
|
||||
|
||||
noticeFile = { testDistro, jdk ->
|
||||
noticeFile = { testDistro ->
|
||||
copySpec {
|
||||
if (testDistro) {
|
||||
from buildServerNoticeTaskProvider
|
||||
} else {
|
||||
if (jdk) {
|
||||
from buildDefaultNoticeTaskProvider
|
||||
} else {
|
||||
from buildDefaultNoJdkNoticeTaskProvider
|
||||
}
|
||||
from buildDefaultNoticeTaskProvider
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -466,14 +457,14 @@ configure(subprojects.findAll { ['archives', 'packages'].contains(it.name) }) {
|
|||
* </dl>
|
||||
*/
|
||||
subprojects {
|
||||
ext.expansionsForDistribution = { distributionType, testDistro, jdk ->
|
||||
ext.expansionsForDistribution = { distributionType, isTestDistro ->
|
||||
final String packagingPathData = "path.data: /var/lib/elasticsearch"
|
||||
final String pathLogs = "/var/log/elasticsearch"
|
||||
final String packagingPathLogs = "path.logs: ${pathLogs}"
|
||||
final String packagingLoggc = "${pathLogs}/gc.log"
|
||||
|
||||
String licenseText
|
||||
if (testDistro) {
|
||||
if (isTestDistro) {
|
||||
licenseText = rootProject.file('licenses/SSPL-1.0+ELASTIC-LICENSE-2.0.txt').getText('UTF-8')
|
||||
} else {
|
||||
licenseText = rootProject.file('licenses/ELASTIC-LICENSE-2.0.txt').getText('UTF-8')
|
||||
|
@ -541,7 +532,7 @@ subprojects {
|
|||
],
|
||||
|
||||
'es.distribution.flavor': [
|
||||
'def': testDistro ? 'oss' : 'default'
|
||||
'def': 'default'
|
||||
],
|
||||
|
||||
'es.distribution.type': [
|
||||
|
@ -552,11 +543,11 @@ subprojects {
|
|||
],
|
||||
|
||||
'es.bundled_jdk': [
|
||||
'def': jdk ? 'true' : 'false'
|
||||
'def': 'true'
|
||||
],
|
||||
|
||||
'license.name': [
|
||||
'deb': testDistro ? 'ASL-2.0' : 'Elastic-License'
|
||||
'deb': 'Elastic-License'
|
||||
],
|
||||
|
||||
'license.text': [
|
||||
|
|
|
@ -46,24 +46,24 @@ plugins {
|
|||
id "nebula.ospackage-base" version "8.6.1"
|
||||
}
|
||||
|
||||
void addProcessFilesTask(String type, boolean oss, boolean jdk) {
|
||||
String packagingFiles = "build/packaging/${oss ? 'oss-' : ''}${jdk ? '' : 'no-jdk-'}${type}"
|
||||
['deb', 'rpm'].each { 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) {
|
||||
into packagingFiles
|
||||
|
||||
with copySpec {
|
||||
from 'src/common'
|
||||
from "src/${type}"
|
||||
filter("tokens" : expansionsForDistribution(type, oss, jdk), ReplaceTokens.class)
|
||||
filter("tokens" : expansionsForDistribution(type, false), ReplaceTokens.class)
|
||||
}
|
||||
|
||||
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 {
|
||||
// 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
|
||||
// since we have different templated files that need to be consumed, but the structure
|
||||
// is the same
|
||||
Closure commonPackageConfig(String type, boolean oss, boolean jdk, String architecture) {
|
||||
def commonPackageConfig(String type, String architecture) {
|
||||
return {
|
||||
onlyIf {
|
||||
OS.current().equals(OS.WINDOWS) == false
|
||||
}
|
||||
dependsOn "process${oss ? 'Oss' : ''}${jdk ? '' : 'NoJdk'}${type.capitalize()}Files"
|
||||
packageName "elasticsearch${oss ? '-oss' : ''}"
|
||||
dependsOn "process${type.capitalize()}Files"
|
||||
packageName "elasticsearch"
|
||||
if (type == 'deb') {
|
||||
if (architecture == 'x64') {
|
||||
arch('amd64')
|
||||
|
@ -114,11 +105,10 @@ Closure commonPackageConfig(String type, boolean oss, boolean jdk, String archit
|
|||
}
|
||||
}
|
||||
// Follow elasticsearch's file naming convention
|
||||
String jdkString = jdk ? "" : "no-jdk-"
|
||||
String prefix = "${architecture == 'aarch64' ? 'aarch64-' : ''}${oss ? 'oss-' : ''}${jdk ? '' : 'no-jdk-'}${type}"
|
||||
String prefix = "${architecture == 'aarch64' ? 'aarch64-' : ''}${type}"
|
||||
destinationDirectory = file("${prefix}/build/distributions")
|
||||
archiveFileName.value(project.provider({ "${packageName}-${project.version}-${jdkString}${archString}.${type}" } ))
|
||||
String packagingFiles = "build/packaging/${oss ? 'oss-' : ''}${jdk ? '' : 'no-jdk-'}${type}"
|
||||
archiveFileName.value(project.provider({ "${packageName}-${project.version}-${archString}.${type}" } ))
|
||||
String packagingFiles = "build/packaging/${type}"
|
||||
|
||||
String scripts = "${packagingFiles}/scripts"
|
||||
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
|
||||
into('/usr/share/elasticsearch') {
|
||||
into('bin') {
|
||||
with binFiles(type, oss, jdk)
|
||||
with binFiles(type, false)
|
||||
}
|
||||
from(rootProject.projectDir) {
|
||||
include 'README.asciidoc'
|
||||
fileMode 0644
|
||||
}
|
||||
into('lib') {
|
||||
with libFiles(oss)
|
||||
with libFiles(false)
|
||||
}
|
||||
into('modules') {
|
||||
with modulesFiles('linux-' + ((architecture == 'x64') ? 'x86_64' : architecture))
|
||||
}
|
||||
if (jdk) {
|
||||
into('jdk') {
|
||||
with jdkFiles(project, 'linux', architecture)
|
||||
}
|
||||
into('jdk') {
|
||||
with jdkFiles(project, 'linux', architecture)
|
||||
}
|
||||
// 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
|
||||
|
@ -178,7 +166,7 @@ Closure commonPackageConfig(String type, boolean oss, boolean jdk, String archit
|
|||
assert type == 'rpm'
|
||||
into('/usr/share/elasticsearch') {
|
||||
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' }
|
||||
}
|
||||
fileMode 0644
|
||||
|
@ -189,12 +177,10 @@ Closure commonPackageConfig(String type, boolean oss, boolean jdk, String archit
|
|||
configurationFile '/etc/elasticsearch/elasticsearch.yml'
|
||||
configurationFile '/etc/elasticsearch/jvm.options'
|
||||
configurationFile '/etc/elasticsearch/log4j2.properties'
|
||||
if (oss == false) {
|
||||
configurationFile '/etc/elasticsearch/role_mapping.yml'
|
||||
configurationFile '/etc/elasticsearch/roles.yml'
|
||||
configurationFile '/etc/elasticsearch/users'
|
||||
configurationFile '/etc/elasticsearch/users_roles'
|
||||
}
|
||||
configurationFile '/etc/elasticsearch/role_mapping.yml'
|
||||
configurationFile '/etc/elasticsearch/roles.yml'
|
||||
configurationFile '/etc/elasticsearch/users'
|
||||
configurationFile '/etc/elasticsearch/users_roles'
|
||||
from("${packagingFiles}") {
|
||||
dirMode 02750
|
||||
into('/etc')
|
||||
|
@ -213,7 +199,7 @@ Closure commonPackageConfig(String type, boolean oss, boolean jdk, String archit
|
|||
createDirectoryEntry true
|
||||
fileType CONFIG | NOREPLACE
|
||||
}
|
||||
String envFile = expansionsForDistribution(type, oss, jdk)['path.env']
|
||||
String envFile = expansionsForDistribution(type, false)['path.env']
|
||||
configurationFile envFile
|
||||
into(new File(envFile).getParent()) {
|
||||
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)
|
||||
|
||||
// the oss package conflicts with the default distribution and vice versa
|
||||
conflicts('elasticsearch' + (oss ? '' : '-oss'))
|
||||
conflicts('elasticsearch-oss')
|
||||
|
||||
into '/usr/share/elasticsearch'
|
||||
with noticeFile(oss, jdk)
|
||||
with noticeFile(false)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -300,17 +286,13 @@ ospackage {
|
|||
into '/usr/share/elasticsearch'
|
||||
}
|
||||
|
||||
Closure commonDebConfig(boolean oss, boolean jdk, String architecture) {
|
||||
Closure commonDebConfig(String architecture) {
|
||||
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
|
||||
// silently ignores setting it. Instead, we set the license as "custom field"
|
||||
if (oss) {
|
||||
customFields['License'] = 'ASL-2.0'
|
||||
} else {
|
||||
customFields['License'] = 'Elastic-License'
|
||||
}
|
||||
customFields['License'] = 'Elastic-License'
|
||||
|
||||
archiveVersion = project.version.replace('-', '~')
|
||||
packageGroup 'web'
|
||||
|
@ -323,46 +305,23 @@ Closure commonDebConfig(boolean oss, boolean jdk, String architecture) {
|
|||
|
||||
into('/usr/share/lintian/overrides') {
|
||||
from('src/deb/lintian/elasticsearch')
|
||||
if (oss) {
|
||||
rename('elasticsearch', 'elasticsearch-oss')
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tasks.register('buildAarch64Deb', Deb) {
|
||||
configure(commonDebConfig(false, true, 'aarch64'))
|
||||
configure(commonDebConfig('aarch64'))
|
||||
}
|
||||
|
||||
tasks.register('buildDeb', Deb) {
|
||||
configure(commonDebConfig(false, true, 'x64'))
|
||||
configure(commonDebConfig('x64'))
|
||||
}
|
||||
|
||||
tasks.register('buildAarch64OssDeb', Deb) {
|
||||
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) {
|
||||
Closure commonRpmConfig(String architecture) {
|
||||
return {
|
||||
configure(commonPackageConfig('rpm', oss, jdk, architecture))
|
||||
configure(commonPackageConfig('rpm', architecture))
|
||||
|
||||
if (oss) {
|
||||
license 'ASL 2.0'
|
||||
} else {
|
||||
license 'Elastic License'
|
||||
}
|
||||
license 'Elastic License'
|
||||
|
||||
packageGroup 'Application/Internet'
|
||||
requires '/bin/bash'
|
||||
|
@ -384,27 +343,11 @@ Closure commonRpmConfig(boolean oss, boolean jdk, String architecture) {
|
|||
}
|
||||
|
||||
tasks.register('buildAarch64Rpm', Rpm) {
|
||||
configure(commonRpmConfig(false, true, 'aarch64'))
|
||||
configure(commonRpmConfig('aarch64'))
|
||||
}
|
||||
|
||||
tasks.register('buildRpm', Rpm) {
|
||||
configure(commonRpmConfig(false, true, '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'))
|
||||
configure(commonRpmConfig('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() }
|
||||
|
@ -481,15 +424,9 @@ subprojects {
|
|||
Path copyrightPath
|
||||
String expectedLicense
|
||||
String licenseFilename
|
||||
if (project.name.contains('oss-')) {
|
||||
copyrightPath = packageExtractionDir.toPath().resolve("usr/share/doc/elasticsearch-oss/copyright")
|
||||
expectedLicense = "ASL-2.0"
|
||||
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"
|
||||
}
|
||||
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/",
|
||||
"Copyright: Elasticsearch B.V. <info@elastic.co>",
|
||||
"License: " + expectedLicense)
|
||||
|
@ -504,11 +441,7 @@ subprojects {
|
|||
onlyIf rpmExists
|
||||
doLast {
|
||||
String licenseFilename
|
||||
if (project.name.contains('oss-')) {
|
||||
licenseFilename = "SSPL-1.0+ELASTIC-LICENSE-2.0.txt"
|
||||
} else {
|
||||
licenseFilename = "ELASTIC-LICENSE-2.0.txt"
|
||||
}
|
||||
licenseFilename = "ELASTIC-LICENSE-2.0.txt"
|
||||
final List<String> licenseLines = Files.readAllLines(rootDir.toPath().resolve("licenses/" + licenseFilename))
|
||||
final Path licensePath = packageExtractionDir.toPath().resolve("usr/share/elasticsearch/LICENSE.txt")
|
||||
assertLinesInFile(licensePath, licenseLines)
|
||||
|
@ -544,11 +477,7 @@ subprojects {
|
|||
exec.standardOutput = output
|
||||
doLast {
|
||||
String expectedLicense
|
||||
if (project.name.contains('oss-')) {
|
||||
expectedLicense = "ASL-2.0"
|
||||
} else {
|
||||
expectedLicense = "Elastic-License"
|
||||
}
|
||||
expectedLicense = "Elastic-License"
|
||||
final Pattern pattern = Pattern.compile("\\s*License: (.+)")
|
||||
final String info = output.toString('UTF-8')
|
||||
final String[] actualLines = info.split("\n")
|
||||
|
@ -581,11 +510,7 @@ subprojects {
|
|||
doLast {
|
||||
String license = output.toString('UTF-8')
|
||||
String expectedLicense
|
||||
if (project.name.contains('oss-')) {
|
||||
expectedLicense = "ASL 2.0"
|
||||
} else {
|
||||
expectedLicense = "Elastic License"
|
||||
}
|
||||
expectedLicense = "Elastic License"
|
||||
if (license != expectedLicense) {
|
||||
throw new GradleException("expected license [${expectedLicense}] for [${-> buildDist.get().outputs.files.singleFile}] but was [${license}]")
|
||||
}
|
||||
|
|
|
@ -1,2 +0,0 @@
|
|||
// This file is intentionally blank. All configuration of the
|
||||
// distribution is done in the parent project.
|
|
@ -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 |
|
@ -22,14 +22,10 @@ List projects = [
|
|||
'benchmarks',
|
||||
'distribution:archives:integ-test-zip',
|
||||
'distribution:archives:windows-zip',
|
||||
'distribution:archives:no-jdk-windows-zip',
|
||||
'distribution:archives:darwin-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-tar',
|
||||
'distribution:archives:no-jdk-linux-tar',
|
||||
'distribution:docker',
|
||||
'distribution:docker:cloud-docker-export',
|
||||
'distribution:docker:cloud-docker-aarch64-export',
|
||||
|
@ -43,10 +39,8 @@ List projects = [
|
|||
'distribution:docker:ubi-docker-export',
|
||||
'distribution:packages:aarch64-deb',
|
||||
'distribution:packages:deb',
|
||||
'distribution:packages:no-jdk-deb',
|
||||
'distribution:packages:aarch64-rpm',
|
||||
'distribution:packages:rpm',
|
||||
'distribution:packages:no-jdk-rpm',
|
||||
'distribution:bwc:bugfix',
|
||||
'distribution:bwc:maintenance',
|
||||
'distribution:bwc:minor',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue