diff --git a/qa/build.gradle b/qa/build.gradle index 1cdd4c62f6..50a9e57d8e 100644 --- a/qa/build.gradle +++ b/qa/build.gradle @@ -40,9 +40,11 @@ task pullBwcPlugin { doLast { ext{ - if (knn_bwc_version.contains("SNAPSHOT")) { - srcUrl = "https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/${knn_bwc_version}/latest/linux/x64/tar/dist/opensearch/opensearch-${knn_bwc_version}-linux-x64.tar.gz" + if (knn_bwc_version.contains("-SNAPSHOT")) { + knn_bwc_version_no_qualifier = knn_bwc_version - "-SNAPSHOT" + srcUrl = "https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/${knn_bwc_version_no_qualifier}/latest/linux/x64/tar/dist/opensearch/opensearch-${knn_bwc_version_no_qualifier}-linux-x64.tar.gz" } else { + knn_bwc_version_no_qualifier = knn_bwc_version srcUrl = "https://artifacts.opensearch.org/releases/bundle/opensearch/${knn_bwc_version}/opensearch-${knn_bwc_version}-linux-x64.tar.gz" } } @@ -52,14 +54,14 @@ task pullBwcPlugin { httpusecaches: false ) copy { - from tarTree(java.nio.file.Path.of(tmp_dir.absolutePath, "opensearch-${knn_bwc_version}-linux-x64.tar.gz")) + from tarTree(java.nio.file.Path.of(tmp_dir.absolutePath, "opensearch-${knn_bwc_version_no_qualifier}-linux-x64.tar.gz")) into tmp_dir.absolutePath } copy { - from(java.nio.file.Path.of(tmp_dir.absolutePath, "opensearch-${knn_bwc_version}", "plugins", "opensearch-knn")) + from(java.nio.file.Path.of(tmp_dir.absolutePath, "opensearch-${knn_bwc_version_no_qualifier}", "plugins", "opensearch-knn")) into java.nio.file.Path.of(tmp_dir.absolutePath, "opensearch-knn") } - delete java.nio.file.Path.of(tmp_dir.absolutePath, "opensearch-${knn_bwc_version}"), java.nio.file.Path.of(tmp_dir.absolutePath, "opensearch-${knn_bwc_version}-linux-x64.tar.gz") + delete java.nio.file.Path.of(tmp_dir.absolutePath, "opensearch-${knn_bwc_version_no_qualifier}"), java.nio.file.Path.of(tmp_dir.absolutePath, "opensearch-${knn_bwc_version_no_qualifier}-linux-x64.tar.gz") } } @@ -68,7 +70,7 @@ task zipBwcPlugin(type: Zip) { dependsOn "pullBwcPlugin" from(java.nio.file.Path.of(tmp_dir.absolutePath, "opensearch-knn")) destinationDirectory = tmp_dir - archiveFileName = "opensearch-knn-${knn_bwc_version}.zip" + archiveFileName = "opensearch-knn-${knn_bwc_version_no_qualifier}.zip" doLast { delete java.nio.file.Path.of(tmp_dir.absolutePath, "opensearch-knn") }