From 59440934e27475f26b9bde42e7db4f48877b84e0 Mon Sep 17 00:00:00 2001 From: Rishikesh1159 Date: Wed, 16 Feb 2022 17:11:54 +0000 Subject: [PATCH] Adding another test case when custom url is not passed and documenting usage of this in Developer Guide Signed-off-by: Rishikesh1159 --- DEVELOPER_GUIDE.md | 9 +++++++++ .../gradle/DistributionDownloadPluginTests.java | 4 ++++ 2 files changed, 13 insertions(+) diff --git a/DEVELOPER_GUIDE.md b/DEVELOPER_GUIDE.md index 6e3886a04e6da..37fbfd27a7525 100644 --- a/DEVELOPER_GUIDE.md +++ b/DEVELOPER_GUIDE.md @@ -340,6 +340,15 @@ somehow. OpenSearch plugins use this configuration to include dependencies that Code that is on the classpath for compiling tests that are part of this project but not production code. The canonical example of this is `junit`. +### Gradle Plugins + +#### Distribution Download Plugin + +We can override the default distribution download url which always downloads latest version of OpenSearch, with custom distribution download url. This will help to pull artifacts from any location. +This custom distribution download url can be passed from external plugins as an argument. + +Sample command: ./gradlew integTest -DcustomDistributionUrl= "custom distribution download url" + ## Misc ### git-secrets diff --git a/buildSrc/src/test/java/org/opensearch/gradle/DistributionDownloadPluginTests.java b/buildSrc/src/test/java/org/opensearch/gradle/DistributionDownloadPluginTests.java index 95a095325587d..d6299311e1d9b 100644 --- a/buildSrc/src/test/java/org/opensearch/gradle/DistributionDownloadPluginTests.java +++ b/buildSrc/src/test/java/org/opensearch/gradle/DistributionDownloadPluginTests.java @@ -114,6 +114,10 @@ public void testCustomDistributionUrlWithoutUrl() { ((DefaultIvyArtifactRepository) project.getRepositories().getAt("opensearch-downloads")).getUrl().toString(), "https://artifacts.opensearch.org" ); + assertEquals( + ((DefaultIvyArtifactRepository) project.getRepositories().getAt("opensearch-downloads2")).getUrl().toString(), + "https://artifacts.opensearch.org" + ); assertEquals( ((DefaultIvyArtifactRepository) project.getRepositories().getAt("opensearch-snapshots")).getUrl().toString(), "https://artifacts.opensearch.org"