From 9e553c5f57b7c6a13f6e9c0f950ea3407436a6f6 Mon Sep 17 00:00:00 2001 From: Sagar <99425694+sgup432@users.noreply.github.com> Date: Mon, 13 Jun 2022 16:16:31 -0700 Subject: [PATCH] Adding custom plugin to publish zips to local repo (#229) Signed-off-by: Sagar Upadhyaya Co-authored-by: Sagar Upadhyaya --- build.gradle | 24 ++++++++++++++++++++++++ scripts/build.sh | 3 +++ 2 files changed, 27 insertions(+) diff --git a/build.gradle b/build.gradle index 2faf47c0..8cb1d376 100644 --- a/build.gradle +++ b/build.gradle @@ -80,6 +80,7 @@ allprojects { } apply plugin: 'opensearch.opensearchplugin' +apply plugin: 'opensearch.pluginzip' licenseFile = rootProject.file('LICENSE.txt') noticeFile = rootProject.file('NOTICE.txt') @@ -144,6 +145,29 @@ project.afterEvaluate { compileJava.options.compilerArgs.removeAll(['--release', version]) } +publishing { + publications { + pluginZip(MavenPublication) { publication -> + pom { + name = "performance-analyzer" + description = "OpenSearch performance-analyzer plugin" + licenses { + license { + name = "The Apache License, Version 2.0" + url = "http://www.apache.org/licenses/LICENSE-2.0.txt" + } + } + developers { + developer { + name = "OpenSearch" + url = "https://github.com/opensearch-project/performance-analyzer" + } + } + } + } + } +} + repositories { mavenCentral() mavenLocal() diff --git a/scripts/build.sh b/scripts/build.sh index 7080c537..7f5ae6bd 100644 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -71,3 +71,6 @@ fi mkdir -p $OUTPUT/plugins cp ./build/distributions/*.zip $OUTPUT/plugins +./gradlew publishPluginZipPublicationToZipStagingRepository -Dopensearch.version=$VERSION -Dbuild.snapshot=$SNAPSHOT -Dbuild.version_qualifier=$QUALIFIER +mkdir -p $OUTPUT/maven/org/opensearch +cp -r ./build/local-staging-repo/org/opensearch/. $OUTPUT/maven/org/opensearch