From 6aab511ea275943bfe53c9b444554c518895f7ab Mon Sep 17 00:00:00 2001 From: pgodithi Date: Sun, 10 Jul 2022 09:19:27 -0400 Subject: [PATCH 1/3] Version increment automation Signed-off-by: pgodithi --- build.gradle | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/build.gradle b/build.gradle index 63a299666..66def40d6 100644 --- a/build.gradle +++ b/build.gradle @@ -270,3 +270,19 @@ run { } } } + +// versionIncrement: Task to auto increment to the next development iteration +task versionIncrement { + 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: "build.gradle") + } + } + } +} \ No newline at end of file From b4c2443f828e60911e0116fc15d18c0dbb48c1d8 Mon Sep 17 00:00:00 2001 From: pgodithi Date: Tue, 12 Jul 2022 17:55:02 -0400 Subject: [PATCH 2/3] Version increment automation: task rename updateVersion Signed-off-by: pgodithi --- build.gradle | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/build.gradle b/build.gradle index 66def40d6..3b79fba4c 100644 --- a/build.gradle +++ b/build.gradle @@ -271,18 +271,15 @@ run { } } -// versionIncrement: Task to auto increment to the next development iteration -task versionIncrement { +// 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: "build.gradle") - } - } + // Include the required files that needs to be updated with new Version + ant.replaceregexp(file:'build.gradle', match: '"opensearch.version", "\\d.*"', replace: '"opensearch.version", "' + newVersion.tokenize('-')[0] + '-SNAPSHOT"', flags:'g', byline:true) } -} \ No newline at end of file +} + From 422e2f7d6a540136d4d749a259ecb684d2579288 Mon Sep 17 00:00:00 2001 From: pgodithi Date: Tue, 26 Jul 2022 14:09:45 -0400 Subject: [PATCH 3/3] updateVersion include .github/workflows/backwards_compatibility_tests_workflow.yml Signed-off-by: pgodithi --- build.gradle | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/build.gradle b/build.gradle index e79e76118..1e861d69b 100644 --- a/build.gradle +++ b/build.gradle @@ -279,6 +279,12 @@ task updateVersion { println "Setting version to ${newVersion}." // String tokenization to support -SNAPSHOT // Include the required files that needs to be updated with new Version + 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/backwards_compatibility_tests_workflow.yml") + } + } ant.replaceregexp(file:'build.gradle', match: '"opensearch.version", "\\d.*"', replace: '"opensearch.version", "' + newVersion.tokenize('-')[0] + '-SNAPSHOT"', flags:'g', byline:true) } } \ No newline at end of file