Add empty plugins dir for archive distributions

Today when installing Elasticsearch from an archive distribution (tar.gz
or zip), an empty plugins folder is not included. This means that if you
install Elasticsearch and immediately run elasticsearch-plugin list, you
will receive an error message about the plugins directory missing. While
the plugins directory would be created when starting Elasticsearch for
the first time, it would be better to just include an empty plugins
directory in the archive distributions. This commit makes this the
case. Note that the package distributions already include an empty
plugins folder.

Relates #21204
This commit is contained in:
Jason Tedor 2016-11-01 15:14:24 -04:00 committed by GitHub
parent eb4b6cd816
commit 8dd91eb2d6
5 changed files with 29 additions and 0 deletions

View File

@ -214,6 +214,17 @@ configure(subprojects.findAll { ['zip', 'tar', 'integ-test-zip'].contains(it.nam
MavenFilteringHack.filter(it, expansions)
}
}
into('') {
// CopySpec does not make it easy to create an empty directory
// so we create the directory that we want, and then point
// CopySpec to its parent to copy to the root of the
// distribution
File plugins = new File(buildDir, 'plugins-hack/plugins')
plugins.mkdirs()
from {
plugins.getParent()
}
}
with commonFiles
from('../src/main/resources') {
include 'bin/*.exe'

View File

@ -73,6 +73,13 @@ setup() {
verify_archive_installation
}
@test "[TAR] verify elasticsearch-plugin list runs without any plugins installed" {
# previously this would fail because the archive installations did
# not create an empty plugins directory
local plugins_list=`$ESHOME/bin/elasticsearch-plugin list`
[[ -z $plugins_list ]]
}
@test "[TAR] elasticsearch fails if java executable is not found" {
local JAVA=$(which java)

View File

@ -74,6 +74,11 @@ setup() {
verify_package_installation
}
@test "[DEB] verify elasticsearch-plugin list runs without any plugins installed" {
local plugins_list=`$ESHOME/bin/elasticsearch-plugin list`
[[ -z $plugins_list ]]
}
@test "[DEB] elasticsearch isn't started by package install" {
# Wait a second to give Elasticsearch a change to start if it is going to.
# This isn't perfect by any means but its something.

View File

@ -73,6 +73,11 @@ setup() {
verify_package_installation
}
@test "[RPM] verify elasticsearch-plugin list runs without any plugins installed" {
local plugins_list=`$ESHOME/bin/elasticsearch-plugin list`
[[ -z $plugins_list ]]
}
@test "[RPM] elasticsearch isn't started by package install" {
# Wait a second to give Elasticsearch a change to start if it is going to.
# This isn't perfect by any means but its something.

View File

@ -89,6 +89,7 @@ verify_archive_installation() {
assert_file "$ESCONFIG/elasticsearch.yml" f elasticsearch elasticsearch 660
assert_file "$ESCONFIG/jvm.options" f elasticsearch elasticsearch 660
assert_file "$ESCONFIG/log4j2.properties" f elasticsearch elasticsearch 660
assert_file "$ESPLUGINS" d elasticsearch elasticsearch 755
assert_file "$ESHOME/lib" d elasticsearch elasticsearch 755
assert_file "$ESHOME/NOTICE.txt" f elasticsearch elasticsearch 644
assert_file "$ESHOME/LICENSE.txt" f elasticsearch elasticsearch 644