2018-02-14 01:49:53 -05:00
|
|
|
/*
|
|
|
|
* Licensed to Elasticsearch under one or more contributor
|
|
|
|
* license agreements. See the NOTICE file distributed with
|
|
|
|
* this work for additional information regarding copyright
|
|
|
|
* ownership. Elasticsearch licenses this file to you under
|
|
|
|
* the Apache License, Version 2.0 (the "License"); you may
|
|
|
|
* not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing,
|
|
|
|
* software distributed under the License is distributed on an
|
|
|
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
|
|
* KIND, either express or implied. See the License for the
|
|
|
|
* specific language governing permissions and limitations
|
|
|
|
* under the License.
|
|
|
|
*/
|
|
|
|
|
|
|
|
import org.apache.tools.ant.taskdefs.condition.Os
|
|
|
|
import org.elasticsearch.gradle.MavenFilteringHack
|
2018-04-24 12:10:51 -04:00
|
|
|
import java.nio.file.Files
|
|
|
|
import java.nio.file.Path
|
2019-11-14 06:01:23 -05:00
|
|
|
|
2020-09-10 02:08:50 -04:00
|
|
|
apply plugin: 'elasticsearch.internal-distribution-archive-setup'
|
2018-02-21 20:46:40 -05:00
|
|
|
|
2020-03-22 11:58:11 -04:00
|
|
|
CopySpec archiveFiles(CopySpec modulesFiles, String distributionType, String platform, String architecture, boolean oss, boolean jdk) {
|
2018-02-21 20:46:40 -05:00
|
|
|
return copySpec {
|
2018-02-14 01:49:53 -05:00
|
|
|
into("elasticsearch-${version}") {
|
2018-05-25 07:56:35 -04:00
|
|
|
into('lib') {
|
2018-07-20 17:03:58 -04:00
|
|
|
with libFiles(oss)
|
2018-05-25 07:56:35 -04:00
|
|
|
}
|
2018-02-14 01:49:53 -05:00
|
|
|
into('config') {
|
|
|
|
dirMode 0750
|
|
|
|
fileMode 0660
|
2019-03-29 08:24:52 -04:00
|
|
|
with configFiles(distributionType, oss, jdk)
|
2020-02-08 18:50:14 -05:00
|
|
|
from {
|
|
|
|
dirMode 0750
|
|
|
|
jvmOptionsDir.getParent()
|
|
|
|
}
|
2018-02-14 01:49:53 -05:00
|
|
|
}
|
|
|
|
into('bin') {
|
2019-03-29 08:24:52 -04:00
|
|
|
with binFiles(distributionType, oss, jdk)
|
2018-02-14 01:49:53 -05:00
|
|
|
}
|
2019-03-15 03:55:15 -04:00
|
|
|
if (jdk) {
|
2019-10-31 15:28:30 -04:00
|
|
|
into("darwin".equals(platform) ? 'jdk.app' : 'jdk') {
|
2020-03-22 11:58:11 -04:00
|
|
|
with jdkFiles(project, platform, architecture)
|
2019-03-08 14:04:18 -05:00
|
|
|
}
|
|
|
|
}
|
2018-02-14 01:49:53 -05:00
|
|
|
into('') {
|
|
|
|
from {
|
|
|
|
dirMode 0755
|
2018-02-21 20:46:40 -05:00
|
|
|
logsDir.getParent()
|
2018-02-14 01:49:53 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
into('') {
|
|
|
|
from {
|
|
|
|
dirMode 0755
|
2018-02-21 20:46:40 -05:00
|
|
|
pluginsDir.getParent()
|
2018-02-14 01:49:53 -05:00
|
|
|
}
|
|
|
|
}
|
2018-04-10 16:58:49 -04:00
|
|
|
from(rootProject.projectDir) {
|
2019-12-19 18:55:38 -05:00
|
|
|
include 'README.asciidoc'
|
2018-04-10 16:58:49 -04:00
|
|
|
}
|
|
|
|
from(rootProject.file('licenses')) {
|
|
|
|
include oss ? 'APACHE-LICENSE-2.0.txt' : 'ELASTIC-LICENSE.txt'
|
|
|
|
rename { 'LICENSE.txt' }
|
|
|
|
}
|
|
|
|
|
2019-03-29 17:20:53 -04:00
|
|
|
with noticeFile(oss, jdk)
|
2018-02-23 11:03:17 -05:00
|
|
|
into('modules') {
|
|
|
|
with modulesFiles
|
2018-02-14 01:49:53 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2018-02-21 20:46:40 -05:00
|
|
|
|
2020-09-10 02:08:50 -04:00
|
|
|
distribution_archives {
|
|
|
|
integTestZip {
|
|
|
|
content {
|
|
|
|
archiveFiles(transportModulesFiles, 'zip', null, 'x64', true, false)
|
|
|
|
}
|
|
|
|
}
|
2018-02-21 20:46:40 -05:00
|
|
|
|
2020-09-10 02:08:50 -04:00
|
|
|
windowsZip {
|
|
|
|
archiveClassifier = 'windows-x86_64'
|
|
|
|
content {
|
|
|
|
archiveFiles(modulesFiles(false, 'windows-x86_64'), 'zip', 'windows', 'x64', false, true)
|
|
|
|
}
|
|
|
|
}
|
2019-03-15 03:55:15 -04:00
|
|
|
|
2020-09-10 02:08:50 -04:00
|
|
|
ossWindowsZip {
|
|
|
|
archiveClassifier = 'windows-x86_64'
|
|
|
|
content {
|
|
|
|
archiveFiles(modulesFiles(true, 'windows-x86_64'), 'zip', 'windows', 'x64', true, true)
|
|
|
|
}
|
|
|
|
}
|
2019-03-15 03:55:15 -04:00
|
|
|
|
2020-09-10 02:08:50 -04:00
|
|
|
noJdkWindowsZip {
|
|
|
|
archiveClassifier = 'no-jdk-windows-x86_64'
|
|
|
|
content {
|
|
|
|
archiveFiles(modulesFiles(false, 'windows-x86_64'), 'zip', 'windows', 'x64', false, false)
|
|
|
|
}
|
|
|
|
}
|
2018-02-23 11:03:17 -05:00
|
|
|
|
2020-09-10 02:08:50 -04:00
|
|
|
ossNoJdkWindowsZip {
|
|
|
|
archiveClassifier = 'no-jdk-windows-x86_64'
|
|
|
|
content {
|
|
|
|
archiveFiles(modulesFiles(true, 'windows-x86_64'), 'zip', 'windows', 'x64', true, false)
|
|
|
|
}
|
|
|
|
}
|
2018-02-23 11:03:17 -05:00
|
|
|
|
2020-09-10 02:08:50 -04:00
|
|
|
darwinTar {
|
|
|
|
archiveClassifier = 'darwin-x86_64'
|
|
|
|
content {
|
|
|
|
archiveFiles(modulesFiles(false, 'darwin-x86_64'), 'tar', 'darwin', 'x64', false, true)
|
|
|
|
}
|
|
|
|
}
|
2018-02-23 11:03:17 -05:00
|
|
|
|
2020-09-10 02:08:50 -04:00
|
|
|
ossDarwinTar {
|
|
|
|
archiveClassifier = 'darwin-x86_64'
|
|
|
|
content {
|
|
|
|
archiveFiles(modulesFiles(true, 'darwin-x86_64'), 'tar', 'darwin', 'x64', true, true)
|
|
|
|
}
|
|
|
|
}
|
2019-03-15 03:55:15 -04:00
|
|
|
|
2020-09-10 02:08:50 -04:00
|
|
|
noJdkDarwinTar {
|
|
|
|
archiveClassifier = 'no-jdk-darwin-x86_64'
|
|
|
|
content {
|
|
|
|
archiveFiles(modulesFiles(false, 'darwin-x86_64'), 'tar', 'darwin', 'x64', false, false)
|
|
|
|
}
|
|
|
|
}
|
2019-03-15 03:55:15 -04:00
|
|
|
|
2020-09-10 02:08:50 -04:00
|
|
|
ossNoJdkDarwinTar {
|
|
|
|
archiveClassifier = 'no-jdk-darwin-x86_64'
|
|
|
|
content {
|
|
|
|
archiveFiles(modulesFiles(true, 'darwin-x86_64'), 'tar', 'darwin', 'x64', true, false)
|
|
|
|
}
|
|
|
|
}
|
2020-03-22 11:58:11 -04:00
|
|
|
|
2020-09-10 02:08:50 -04:00
|
|
|
linuxAarch64Tar {
|
|
|
|
archiveClassifier = 'linux-aarch64'
|
|
|
|
content {
|
|
|
|
archiveFiles(modulesFiles(false, 'linux-aarch64'), 'tar', 'linux', 'aarch64', false, true)
|
|
|
|
}
|
|
|
|
}
|
2019-01-29 14:18:30 -05:00
|
|
|
|
2020-09-10 02:08:50 -04:00
|
|
|
linuxTar {
|
|
|
|
archiveClassifier = 'linux-x86_64'
|
|
|
|
content {
|
|
|
|
archiveFiles(modulesFiles(false, 'linux-x86_64'), 'tar', 'linux', 'x64', false, true)
|
|
|
|
}
|
|
|
|
}
|
2020-03-22 11:58:11 -04:00
|
|
|
|
2020-09-10 02:08:50 -04:00
|
|
|
ossLinuxAarch64Tar {
|
|
|
|
archiveClassifier = 'linux-aarch64'
|
|
|
|
content {
|
|
|
|
archiveFiles(modulesFiles(true, 'linux-aarch64'), 'tar', 'linux', 'aarch64', true, true)
|
|
|
|
}
|
|
|
|
}
|
2019-01-29 14:18:30 -05:00
|
|
|
|
2020-09-10 02:08:50 -04:00
|
|
|
ossLinuxTar {
|
|
|
|
archiveClassifier = 'linux-x86_64'
|
|
|
|
content {
|
|
|
|
archiveFiles(modulesFiles(true, 'linux-x86_64'), 'tar', 'linux', 'x64', true, true)
|
|
|
|
}
|
|
|
|
}
|
2019-03-15 03:55:15 -04:00
|
|
|
|
2020-09-10 02:08:50 -04:00
|
|
|
noJdkLinuxTar {
|
|
|
|
archiveClassifier = 'no-jdk-linux-x86_64'
|
|
|
|
content {
|
|
|
|
archiveFiles(modulesFiles(false, 'linux-x86_64'), 'tar', 'linux', 'x64', false, false)
|
|
|
|
}
|
|
|
|
}
|
2019-03-15 03:55:15 -04:00
|
|
|
|
2020-09-10 02:08:50 -04:00
|
|
|
ossNoJdkLinuxTar {
|
|
|
|
archiveClassifier = 'no-jdk-linux-x86_64'
|
|
|
|
content {
|
|
|
|
archiveFiles(modulesFiles(true, 'linux-x86_64'), 'tar', 'linux', 'x64', true, false)
|
|
|
|
}
|
|
|
|
}
|
2018-02-21 20:46:40 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
subprojects {
|
|
|
|
apply plugin: 'distribution'
|
2020-08-26 09:04:12 -04:00
|
|
|
apply plugin: 'elasticsearch.internal-distribution-archive-check'
|
|
|
|
|
2019-05-08 07:00:11 -04:00
|
|
|
group = "org.elasticsearch.distribution.${name.startsWith("oss-") ? "oss" : "default"}"
|
|
|
|
}
|
|
|
|
|
2018-02-21 20:46:40 -05:00
|
|
|
/*****************************************************************************
|
|
|
|
* Rest test config *
|
|
|
|
*****************************************************************************/
|
2020-09-10 02:08:50 -04:00
|
|
|
project('integ-test-zip') {
|
2018-02-21 20:46:40 -05:00
|
|
|
apply plugin: 'elasticsearch.standalone-rest-test'
|
|
|
|
apply plugin: 'elasticsearch.rest-test'
|
|
|
|
|
2019-05-08 07:00:11 -04:00
|
|
|
group = "org.elasticsearch.distribution.integ-test-zip"
|
|
|
|
|
2018-03-08 22:46:54 -05:00
|
|
|
integTest {
|
2018-02-21 20:46:40 -05:00
|
|
|
dependsOn assemble
|
2020-08-04 08:46:32 -04:00
|
|
|
if (Os.isFamily(Os.FAMILY_WINDOWS) && System.getProperty('tests.timeoutSuite') == null) {
|
|
|
|
// override the suite timeout to 30 mins for windows, because it has the most inefficient filesystem known to man
|
|
|
|
systemProperty 'tests.timeoutSuite', '1800000!'
|
2018-02-21 20:46:40 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
processTestResources {
|
|
|
|
inputs.properties(project(':distribution').restTestExpansions)
|
|
|
|
MavenFilteringHack.filter(it, project(':distribution').restTestExpansions)
|
|
|
|
}
|
|
|
|
|
2019-05-08 07:00:11 -04:00
|
|
|
// The integ-test-distribution is published to maven
|
2020-05-14 21:56:59 -04:00
|
|
|
apply plugin: 'elasticsearch.publish'
|
2018-02-21 20:46:40 -05:00
|
|
|
|
2018-02-23 11:03:17 -05:00
|
|
|
// make the pom file name use elasticsearch instead of the project name
|
|
|
|
archivesBaseName = "elasticsearch${it.name.contains('oss') ? '-oss' : ''}"
|
2018-02-21 20:46:40 -05:00
|
|
|
|
2020-09-10 02:08:50 -04:00
|
|
|
String buildTask = "build${it.name.replaceAll(/-[a-z]/) { it.substring(1).toUpperCase() }.capitalize()}"
|
|
|
|
ext.buildDist = parent.tasks.named(buildTask)
|
|
|
|
|
2018-02-21 20:46:40 -05:00
|
|
|
publishing {
|
|
|
|
publications {
|
|
|
|
nebula {
|
2020-05-14 21:56:59 -04:00
|
|
|
pom.packaging = 'zip'
|
2020-04-08 19:47:02 -04:00
|
|
|
artifact(buildDist.flatMap { it.archiveFile })
|
2018-02-21 20:46:40 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|