From 10efd826944acd2ddcbb03a8eea438547cfb0fab Mon Sep 17 00:00:00 2001 From: Nik Everett Date: Tue, 6 Feb 2018 14:20:44 -0500 Subject: [PATCH] SQL: Shift sql-cli into its proper home The old home made sense before x-pack was split. The new home lines up with where security keeps its scripts. The jar file wasn't being included any more so this re-adds that. Original commit: elastic/x-pack-elasticsearch@d3ec941397be3783b247e0a773baed27e1cee491 --- plugin/sql/build.gradle | 25 +++++++++++++++---- .../{bin/x-pack => sql/src/main/bin}/sql-cli | 0 .../x-pack => sql/src/main/bin}/sql-cli.bat | 0 .../plugin-metadata/plugin-security.policy | 0 .../packaging/tests/bootstrap_password.bash | 2 +- .../test/resources/packaging/utils/xpack.bash | 2 ++ 6 files changed, 23 insertions(+), 6 deletions(-) rename plugin/{bin/x-pack => sql/src/main/bin}/sql-cli (100%) rename plugin/{bin/x-pack => sql/src/main/bin}/sql-cli.bat (100%) create mode 100644 plugin/sql/src/main/plugin-metadata/plugin-security.policy diff --git a/plugin/sql/build.gradle b/plugin/sql/build.gradle index fd72e2d35f4..5a8e4f72d0b 100644 --- a/plugin/sql/build.gradle +++ b/plugin/sql/build.gradle @@ -12,9 +12,14 @@ esplugin { noticeFile project(':x-pack-elasticsearch').file('NOTICE.txt') } +configurations { + // Bundles the sql-cli.jar into the distribution + bin +} + archivesBaseName = 'x-pack-sql' -// TODO: enable this once we have tests +// All integration tests live in qa modules integTest.enabled = false dependencies { @@ -28,6 +33,20 @@ dependencies { testCompile project(path: ':modules:reindex', configuration: 'runtime') testCompile project(path: ':modules:parent-join', configuration: 'runtime') testCompile project(path: ':modules:analysis-common', configuration: 'runtime') + + bin(project(path: xpackModule('sql:sql-cli'))) { + // sql-cli bundles all of its dependencies into a single executable jar + transitive = false + } +} + +/* Bundle the sql-cli into the binary files. This is useful + * because it is an executable jar that can be moved wherever + * it is needed. */ +bundlePlugin { + from (configurations.bin) { + into 'elasticsearch/bin' + } } dependencyLicenses { @@ -107,7 +126,3 @@ task regen { } } } - -//project(xpackModule('core')).bundlePlugin { -// from jar -//} diff --git a/plugin/bin/x-pack/sql-cli b/plugin/sql/src/main/bin/sql-cli similarity index 100% rename from plugin/bin/x-pack/sql-cli rename to plugin/sql/src/main/bin/sql-cli diff --git a/plugin/bin/x-pack/sql-cli.bat b/plugin/sql/src/main/bin/sql-cli.bat similarity index 100% rename from plugin/bin/x-pack/sql-cli.bat rename to plugin/sql/src/main/bin/sql-cli.bat diff --git a/plugin/sql/src/main/plugin-metadata/plugin-security.policy b/plugin/sql/src/main/plugin-metadata/plugin-security.policy new file mode 100644 index 00000000000..e69de29bb2d diff --git a/qa/vagrant/src/test/resources/packaging/tests/bootstrap_password.bash b/qa/vagrant/src/test/resources/packaging/tests/bootstrap_password.bash index a4bf0067ffe..a385abd6d2f 100644 --- a/qa/vagrant/src/test/resources/packaging/tests/bootstrap_password.bash +++ b/qa/vagrant/src/test/resources/packaging/tests/bootstrap_password.bash @@ -131,7 +131,7 @@ SETUP_OK password=$(grep "PASSWORD elastic = " /tmp/setup-passwords-output-with-bootstrap | sed "s/PASSWORD elastic = //") - run $ESHOME/bin/x-pack/sql-cli --debug true "http://elastic@127.0.0.1:9200" <