From 6ba24264b351f2ecffa6bf2852160e2380e737db Mon Sep 17 00:00:00 2001 From: Mohammad Qureshi <47198598+qreshi@users.noreply.github.com> Date: Mon, 25 Jan 2021 16:31:32 -0800 Subject: [PATCH] Rename plugin for more consistent naming convention (#339) * Rename plugin name * Change buildDeb arch from 'amd64' to 'all' * Add artifact rename tasks for buildRpm and buildDeb --- alerting/build.gradle | 2 +- .../alerting/resthandler/MonitorRestApiIT.kt | 2 +- build-tools/pkgbuild.gradle | 20 ++++++++++++++++--- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/alerting/build.gradle b/alerting/build.gradle index 0cbc2e75..7d5f1e17 100644 --- a/alerting/build.gradle +++ b/alerting/build.gradle @@ -36,7 +36,7 @@ if (isSnapshot) { } esplugin { - name 'opendistro_alerting' + name 'opendistro-alerting' description 'Amazon OpenDistro alerting plugin' classname 'com.amazon.opendistroforelasticsearch.alerting.AlertingPlugin' extendedPlugins = ['lang-painless'] diff --git a/alerting/src/test/kotlin/com/amazon/opendistroforelasticsearch/alerting/resthandler/MonitorRestApiIT.kt b/alerting/src/test/kotlin/com/amazon/opendistroforelasticsearch/alerting/resthandler/MonitorRestApiIT.kt index 1d0222ef..5a01b5ea 100644 --- a/alerting/src/test/kotlin/com/amazon/opendistroforelasticsearch/alerting/resthandler/MonitorRestApiIT.kt +++ b/alerting/src/test/kotlin/com/amazon/opendistroforelasticsearch/alerting/resthandler/MonitorRestApiIT.kt @@ -70,7 +70,7 @@ class MonitorRestApiIT : AlertingRestTestCase() { for (nodeInfo in nodesInfo.values) { val plugins = nodeInfo["plugins"] as List> for (plugin in plugins) { - if (plugin["name"] == "opendistro_alerting") { + if (plugin["name"] == "opendistro-alerting") { return } } diff --git a/build-tools/pkgbuild.gradle b/build-tools/pkgbuild.gradle index c275cbc9..b301545c 100644 --- a/build-tools/pkgbuild.gradle +++ b/build-tools/pkgbuild.gradle @@ -34,13 +34,27 @@ afterEvaluate { buildRpm { arch = 'NOARCH' - archiveName "${packageName}-${version}.rpm" dependsOn 'assemble' + finalizedBy 'renameRpm' + task renameRpm(type: Copy) { + from("$buildDir/distributions") + into("$buildDir/distributions") + include archiveName + rename archiveName, "${packageName}-${version}.rpm" + doLast { delete file("$buildDir/distributions/$archiveName") } + } } buildDeb { - arch = 'amd64' - archiveName "${packageName}-${version}.deb" + arch = 'all' dependsOn 'assemble' + finalizedBy 'renameDeb' + task renameDeb(type: Copy) { + from("$buildDir/distributions") + into("$buildDir/distributions") + include archiveName + rename archiveName, "${packageName}-${version}.deb" + doLast { delete file("$buildDir/distributions/$archiveName") } + } } } \ No newline at end of file