Packaging: Remove windows bin files from the tar distribution (#30596)

This commit removes windows specific files from the tar distribution.
Windows users use the zip, linux users use the tar.
This commit is contained in:
Ryan Ernst 2018-06-18 19:02:51 +02:00 committed by GitHub
parent 73549281e8
commit f3297ed23a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 24 additions and 25 deletions

View File

@ -18,7 +18,6 @@
*/ */
import org.apache.tools.ant.taskdefs.condition.Os import org.apache.tools.ant.taskdefs.condition.Os
import org.apache.tools.ant.filters.FixCrLfFilter
import org.elasticsearch.gradle.BuildPlugin import org.elasticsearch.gradle.BuildPlugin
import org.elasticsearch.gradle.EmptyDirTask import org.elasticsearch.gradle.EmptyDirTask
import org.elasticsearch.gradle.LoggedExec import org.elasticsearch.gradle.LoggedExec
@ -59,13 +58,6 @@ CopySpec archiveFiles(CopySpec modulesFiles, String distributionType, boolean os
} }
into('bin') { into('bin') {
with binFiles(distributionType, oss) with binFiles(distributionType, oss)
with copySpec {
from('../src/bin') {
include '*.bat'
filter(FixCrLfFilter, eol: FixCrLfFilter.CrLf.newInstance('crlf'))
}
MavenFilteringHack.filter(it, expansionsForDistribution(distributionType, oss))
}
} }
into('') { into('') {
from { from {
@ -88,9 +80,6 @@ CopySpec archiveFiles(CopySpec modulesFiles, String distributionType, boolean os
} }
with noticeFile with noticeFile
from('../src') {
include 'bin/*.exe'
}
into('modules') { into('modules') {
with modulesFiles with modulesFiles
} }

View File

@ -21,6 +21,7 @@ import org.elasticsearch.gradle.ConcatFilesTask
import org.elasticsearch.gradle.MavenFilteringHack import org.elasticsearch.gradle.MavenFilteringHack
import org.elasticsearch.gradle.NoticeTask import org.elasticsearch.gradle.NoticeTask
import org.elasticsearch.gradle.test.RunTask import org.elasticsearch.gradle.test.RunTask
import org.apache.tools.ant.filters.FixCrLfFilter
import java.nio.file.Path import java.nio.file.Path
@ -281,15 +282,28 @@ configure(subprojects.findAll { ['archives', 'packages'].contains(it.name) }) {
binFiles = { distributionType, oss -> binFiles = { distributionType, oss ->
copySpec { copySpec {
// non-windows files, for all distributions
with copySpec { with copySpec {
// main bin files, processed with distribution specific substitutions
// everything except windows files
from '../src/bin' from '../src/bin'
exclude '*.exe' exclude '*.exe'
exclude '*.bat' exclude '*.bat'
eachFile { it.setMode(0755) } eachFile { it.setMode(0755) }
MavenFilteringHack.filter(it, expansionsForDistribution(distributionType, oss)) MavenFilteringHack.filter(it, expansionsForDistribution(distributionType, oss))
} }
// windows files, only for zip
if (distributionType == 'zip') {
with copySpec {
from '../src/bin'
include '*.bat'
filter(FixCrLfFilter, eol: FixCrLfFilter.CrLf.newInstance('crlf'))
MavenFilteringHack.filter(it, expansionsForDistribution(distributionType, oss))
}
with copySpec {
from '../src/bin'
include '*.exe'
}
}
// module provided bin files
with copySpec { with copySpec {
eachFile { it.setMode(0755) } eachFile { it.setMode(0755) }
if (oss) { if (oss) {
@ -297,6 +311,9 @@ configure(subprojects.findAll { ['archives', 'packages'].contains(it.name) }) {
} else { } else {
from project(':distribution').buildDefaultBin from project(':distribution').buildDefaultBin
} }
if (distributionType != 'zip') {
exclude '*.bat'
}
} }
} }
} }

View File

@ -8,3 +8,8 @@ The systemd service file `/usr/lib/systemd/system/elasticsearch.service`
was previously marked as a configuration file in rpm and deb packages. was previously marked as a configuration file in rpm and deb packages.
Overrides to the systemd elasticsearch service should be made Overrides to the systemd elasticsearch service should be made
in `/etc/systemd/system/elasticsearch.service.d/override.conf`. in `/etc/systemd/system/elasticsearch.service.d/override.conf`.
==== tar package no longer includes windows specific files
The tar package previously included files in the `bin` directory meant only
for windows. These files have been removed. Use the `zip` package instead.

View File

@ -15,30 +15,18 @@ verify_xpack_installation() {
#assert_file "$ESHOME/bin" d $user $group 755 #assert_file "$ESHOME/bin" d $user $group 755
local binaryFiles=( local binaryFiles=(
'elasticsearch-certgen' 'elasticsearch-certgen'
'elasticsearch-certgen.bat'
'elasticsearch-certutil' 'elasticsearch-certutil'
'elasticsearch-certutil.bat'
'elasticsearch-croneval' 'elasticsearch-croneval'
'elasticsearch-croneval.bat'
'elasticsearch-migrate' 'elasticsearch-migrate'
'elasticsearch-migrate.bat'
'elasticsearch-saml-metadata' 'elasticsearch-saml-metadata'
'elasticsearch-saml-metadata.bat'
'elasticsearch-setup-passwords' 'elasticsearch-setup-passwords'
'elasticsearch-setup-passwords.bat'
'elasticsearch-sql-cli' 'elasticsearch-sql-cli'
'elasticsearch-sql-cli.bat'
"elasticsearch-sql-cli-$(cat version).jar" # This jar is executable so we pitch it in bin so folks will find it "elasticsearch-sql-cli-$(cat version).jar" # This jar is executable so we pitch it in bin so folks will find it
'elasticsearch-syskeygen' 'elasticsearch-syskeygen'
'elasticsearch-syskeygen.bat'
'elasticsearch-users' 'elasticsearch-users'
'elasticsearch-users.bat'
'x-pack-env' 'x-pack-env'
'x-pack-env.bat'
'x-pack-security-env' 'x-pack-security-env'
'x-pack-security-env.bat'
'x-pack-watcher-env' 'x-pack-watcher-env'
'x-pack-watcher-env.bat'
) )
local binaryFilesCount=5 # start with oss distro number local binaryFilesCount=5 # start with oss distro number