diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 60d06b18e..6d5619427 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -29,28 +29,28 @@ jobs: - name: Assemble anomaly-detection run: | - ./gradlew assemble -Dopensearch.version=1.3.4-SNAPSHOT - echo "Creating ./src/test/resources/org/opensearch/ad/bwc/anomaly-detection/1.3.4.0-SNAPSHOT ..." - mkdir -p ./src/test/resources/org/opensearch/ad/bwc/anomaly-detection/1.3.4.0-SNAPSHOT - echo "Copying ./build/distributions/*.zip to ./src/test/resources/org/opensearch/ad/bwc/anomaly-detection/1.3.4.0-SNAPSHOT ..." + ./gradlew assemble -Dopensearch.version=1.3.5-SNAPSHOT + echo "Creating ./src/test/resources/org/opensearch/ad/bwc/anomaly-detection/1.3.5.0-SNAPSHOT ..." + mkdir -p ./src/test/resources/org/opensearch/ad/bwc/anomaly-detection/1.3.5.0-SNAPSHOT + echo "Copying ./build/distributions/*.zip to ./src/test/resources/org/opensearch/ad/bwc/anomaly-detection/1.3.5.0-SNAPSHOT ..." ls ./build/distributions/ - cp ./build/distributions/*.zip ./src/test/resources/org/opensearch/ad/bwc/anomaly-detection/1.3.4.0-SNAPSHOT - echo "Copied ./build/distributions/*.zip to ./src/test/resources/org/opensearch/ad/bwc/anomaly-detection/1.3.4.0-SNAPSHOT ..." - ls ./src/test/resources/org/opensearch/ad/bwc/anomaly-detection/1.3.4.0-SNAPSHOT + cp ./build/distributions/*.zip ./src/test/resources/org/opensearch/ad/bwc/anomaly-detection/1.3.5.0-SNAPSHOT + echo "Copied ./build/distributions/*.zip to ./src/test/resources/org/opensearch/ad/bwc/anomaly-detection/1.3.5.0-SNAPSHOT ..." + ls ./src/test/resources/org/opensearch/ad/bwc/anomaly-detection/1.3.5.0-SNAPSHOT - name: Build and Run Tests run: | - ./gradlew build -Dopensearch.version=1.3.4-SNAPSHOT + ./gradlew build -Dopensearch.version=1.3.5-SNAPSHOT - name: Publish to Maven Local run: | - ./gradlew publishToMavenLocal -Dopensearch.version=1.3.4-SNAPSHOT + ./gradlew publishToMavenLocal -Dopensearch.version=1.3.5-SNAPSHOT - name: Multi Nodes Integration Testing run: | ./gradlew integTest -PnumNodes=3 - name: Pull and Run Docker run: | plugin=`ls build/distributions/*.zip` - version=1.3.4 - plugin_version=1.3.4.0-SNAPSHOT + version=1.3.5 + plugin_version=1.3.5.0-SNAPSHOT echo Using OpenSearch $version with AD $plugin_version cd .. if docker pull opensearchstaging/opensearch:$version diff --git a/build.gradle b/build.gradle index 7832b7d40..33265ae0b 100644 --- a/build.gradle +++ b/build.gradle @@ -17,7 +17,7 @@ buildscript { ext { opensearch_group = "org.opensearch" isSnapshot = "true" == System.getProperty("build.snapshot", "true") - opensearch_version = System.getProperty("opensearch.version", "1.3.4-SNAPSHOT") + opensearch_version = System.getProperty("opensearch.version", "1.3.5-SNAPSHOT") if (isSnapshot) { plugin_version = opensearch_version.substring(0, opensearch_version.indexOf("-")) } else { @@ -758,3 +758,20 @@ validateNebulaPom.enabled = false tasks.withType(licenseHeaders.class) { additionalLicense 'AL ', 'Apache', 'Licensed under the Apache License, Version 2.0 (the "License")' } + +// updateVersion: Task to auto increment to the next development iteration +task updateVersion { + onlyIf { System.getProperty('newVersion') } + doLast { + ext.newVersion = System.getProperty('newVersion') + println "Setting version to ${newVersion}." + // String tokenization to support -SNAPSHOT + ant.replaceregexp(match: opensearch_version.tokenize('-')[0], replace: newVersion.tokenize('-')[0], flags:'g', byline:true) { + fileset(dir: projectDir) { + // Include the required files that needs to be updated with new Version + include(name: ".github/workflows/CI.yml") + } + } + ant.replaceregexp(file:'build.gradle', match: '"opensearch.version", "\\d.*"', replace: '"opensearch.version", "' + newVersion.tokenize('-')[0] + '-SNAPSHOT"', flags:'g', byline:true) + } +}