From 72d727de8fab7ccd44d78ee1871c6caabb53bbed Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Tue, 16 Aug 2022 16:41:16 -0700 Subject: [PATCH] Staging for version increment automation (#409) (#468) * Version increment automation Signed-off-by: pgodithi * Version increment automation: task rename updateVersion Signed-off-by: pgodithi (cherry picked from commit 0f0ba16ddda2f3d22164564a295ede09fab71413) Signed-off-by: prudhvigodithi Signed-off-by: pgodithi Signed-off-by: prudhvigodithi Co-authored-by: Prudhvi Godithi Signed-off-by: Ronnak Saxena --- build.gradle | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/build.gradle b/build.gradle index 5fa23d192..63779a569 100644 --- a/build.gradle +++ b/build.gradle @@ -703,3 +703,14 @@ mixedCluster { systemProperty 'cluster.mixed', "$mixedClusterFlag" systemProperty 'cluster.number_of_nodes', "${_numNodes}" } + +// 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(file:'build.gradle', match: '"opensearch.version", "\\d.*"', replace: '"opensearch.version", "' + newVersion.tokenize('-')[0] + '-SNAPSHOT"', flags:'g', byline:true) + } +}