Skip to content

Commit

Permalink
Packaging: Remove windows bin files from the tar distribution (#30596)
Browse files Browse the repository at this point in the history
This commit removes windows specific files from the tar distribution.
Windows users use the zip, linux users use the tar.
  • Loading branch information
rjernst authored Jun 18, 2018
1 parent 7354928 commit f3297ed
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 25 deletions.
11 changes: 0 additions & 11 deletions distribution/archives/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
*/

import org.apache.tools.ant.taskdefs.condition.Os
import org.apache.tools.ant.filters.FixCrLfFilter
import org.elasticsearch.gradle.BuildPlugin
import org.elasticsearch.gradle.EmptyDirTask
import org.elasticsearch.gradle.LoggedExec
Expand Down Expand Up @@ -59,13 +58,6 @@ CopySpec archiveFiles(CopySpec modulesFiles, String distributionType, boolean os
}
into('bin') {
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('') {
from {
Expand All @@ -88,9 +80,6 @@ CopySpec archiveFiles(CopySpec modulesFiles, String distributionType, boolean os
}

with noticeFile
from('../src') {
include 'bin/*.exe'
}
into('modules') {
with modulesFiles
}
Expand Down
21 changes: 19 additions & 2 deletions distribution/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import org.elasticsearch.gradle.ConcatFilesTask
import org.elasticsearch.gradle.MavenFilteringHack
import org.elasticsearch.gradle.NoticeTask
import org.elasticsearch.gradle.test.RunTask
import org.apache.tools.ant.filters.FixCrLfFilter

import java.nio.file.Path

Expand Down Expand Up @@ -281,22 +282,38 @@ configure(subprojects.findAll { ['archives', 'packages'].contains(it.name) }) {

binFiles = { distributionType, oss ->
copySpec {
// non-windows files, for all distributions
with copySpec {
// main bin files, processed with distribution specific substitutions
// everything except windows files
from '../src/bin'
exclude '*.exe'
exclude '*.bat'
eachFile { it.setMode(0755) }
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 {
eachFile { it.setMode(0755) }
if (oss) {
from project(':distribution').buildOssBin
} else {
from project(':distribution').buildDefaultBin
}
if (distributionType != 'zip') {
exclude '*.bat'
}
}
}
}
Expand Down
5 changes: 5 additions & 0 deletions docs/reference/migration/migrate_7_0/packaging.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Overrides to the systemd elasticsearch service should be made
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.
12 changes: 0 additions & 12 deletions x-pack/qa/vagrant/src/test/resources/packaging/utils/xpack.bash
Original file line number Diff line number Diff line change
Expand Up @@ -15,30 +15,18 @@ verify_xpack_installation() {
#assert_file "$ESHOME/bin" d $user $group 755
local binaryFiles=(
'elasticsearch-certgen'
'elasticsearch-certgen.bat'
'elasticsearch-certutil'
'elasticsearch-certutil.bat'
'elasticsearch-croneval'
'elasticsearch-croneval.bat'
'elasticsearch-migrate'
'elasticsearch-migrate.bat'
'elasticsearch-saml-metadata'
'elasticsearch-saml-metadata.bat'
'elasticsearch-setup-passwords'
'elasticsearch-setup-passwords.bat'
'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-syskeygen'
'elasticsearch-syskeygen.bat'
'elasticsearch-users'
'elasticsearch-users.bat'
'x-pack-env'
'x-pack-env.bat'
'x-pack-security-env'
'x-pack-security-env.bat'
'x-pack-watcher-env'
'x-pack-watcher-env.bat'
)

local binaryFilesCount=5 # start with oss distro number
Expand Down

0 comments on commit f3297ed

Please sign in to comment.