From 328393243114a6969d4c7db01acfeabae7c6abf9 Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Fri, 1 Apr 2022 20:37:41 -0400 Subject: [PATCH] Make sure qualifier default is alpha1 in IM (#323) Signed-off-by: Peter Zhu --- .../workflows/multi-node-test-workflow.yml | 2 +- .github/workflows/test-and-build-workflow.yml | 2 +- build.gradle | 21 ++++++++++++------- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/.github/workflows/multi-node-test-workflow.yml b/.github/workflows/multi-node-test-workflow.yml index 3ec2acf0f..8f634003a 100644 --- a/.github/workflows/multi-node-test-workflow.yml +++ b/.github/workflows/multi-node-test-workflow.yml @@ -24,7 +24,7 @@ jobs: - name: Checkout Branch uses: actions/checkout@v2 - name: Run integration tests with multi node config - run: ./gradlew integTest -PnumNodes=3 -Dopensearch.version=2.0.0-alpha1-SNAPSHOT + run: ./gradlew integTest -PnumNodes=3 - name: Upload failed logs uses: actions/upload-artifact@v2 if: failure() diff --git a/.github/workflows/test-and-build-workflow.yml b/.github/workflows/test-and-build-workflow.yml index a247a8c9c..b3dd0ded9 100644 --- a/.github/workflows/test-and-build-workflow.yml +++ b/.github/workflows/test-and-build-workflow.yml @@ -12,7 +12,7 @@ jobs: # Job name name: Build Index Management env: - BUILD_ARGS: -D"opensearch.version=2.0.0-alpha1-SNAPSHOT" ${{ matrix.os_build_args }} + BUILD_ARGS: ${{ matrix.os_build_args }} WORKING_DIR: ${{ matrix.working_directory }}. strategy: # This setting says that all jobs should finish, even if one fails diff --git a/build.gradle b/build.gradle index 98e16797e..fbc19e858 100644 --- a/build.gradle +++ b/build.gradle @@ -13,9 +13,18 @@ import java.util.function.Predicate buildscript { ext { + isSnapshot = "true" == System.getProperty("build.snapshot", "true") opensearch_version = System.getProperty("opensearch.version", "2.0.0-alpha1-SNAPSHOT") - // 1.1.0 -> 1.1.0.0, 1.1.0-SNAPSHOT -> 1.1.0.0-SNAPSHOT, and 2.0.0-alpha1-SNAPSHOT -> 2.0.0.0-alpha1-SNAPSHOT - opensearch_build = opensearch_version.replaceAll(/(\.\d)(-.*)$/, '$1.0$2') + buildVersionQualifier = System.getProperty("build.version_qualifier", "alpha1") + // 2.0.0-alpha1-SNAPSHOT -> 2.0.0.0-alpha1-SNAPSHOT + version_tokens = opensearch_version.tokenize('-') + opensearch_build = version_tokens[0] + '.0' + if (buildVersionQualifier) { + opensearch_build += "-${buildVersionQualifier}" + } + if (isSnapshot) { + opensearch_build += "-SNAPSHOT" + } // notification_version = System.getProperty("notification.version", opensearch_build) common_utils_version = System.getProperty("common_utils.version", opensearch_build) job_scheduler_version = System.getProperty("job_scheduler_version.version", opensearch_build) @@ -127,17 +136,13 @@ configurations.testImplementation { ext { projectSubstitutions = [:] - isSnapshot = "true" == System.getProperty("build.snapshot", "true") licenseFile = rootProject.file('LICENSE') noticeFile = rootProject.file('NOTICE') } allprojects { group = "org.opensearch" - version = "${opensearch_version}" - "-SNAPSHOT" + ".0" - if (isSnapshot) { - version += "-SNAPSHOT" - } + version = "${opensearch_build}" } dependencies { @@ -347,7 +352,7 @@ String bwcFilePath = "src/test/resources/bwc/" testClusters { "${baseName}$i" { testDistribution = "ARCHIVE" - versions = ["7.10.2", "2.0.0-alpha1-SNAPSHOT"] + versions = ["7.10.2", opensearch_version] numberOfNodes = 3 plugin(provider(new Callable(){ @Override