Skip to content

Commit 6667bfb

Browse files
Staging for version increment automation (#391)
* Version increment automation Signed-off-by: pgodithi <pgodithi@amazon.com> * Version increment automation Signed-off-by: pgodithi <pgodithi@amazon.com> * Version increment automation Signed-off-by: pgodithi <pgodithi@amazon.com> * Version increment automation Signed-off-by: pgodithi <pgodithi@amazon.com> * Version increment automation Signed-off-by: pgodithi <pgodithi@amazon.com> * Version increment automation: task rename updateVersion Signed-off-by: pgodithi <pgodithi@amazon.com>
1 parent 8e01eaa commit 6667bfb

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

reports-scheduler/build.gradle

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -559,3 +559,21 @@ if (!usingRemoteCluster && !usingMultiNode) {
559559
}
560560

561561
apply from: 'build-tools/pkgbuild.gradle'
562+
563+
// updateVersion: Task to auto increment to the next development iteration
564+
task updateVersion {
565+
onlyIf { System.getProperty('newVersion') }
566+
doLast {
567+
ext.newVersion = System.getProperty('newVersion')
568+
println "Setting version to ${newVersion}."
569+
// String tokenization to support -SNAPSHOT
570+
ant.replaceregexp(file:'build.gradle', match: '"opensearch.version", "\\d.*"', replace: '"opensearch.version", "' + newVersion.tokenize('-')[0] + '-SNAPSHOT"', flags:'g', byline:true)
571+
ant.replaceregexp(file:'../.github/workflows/dashboards-reports-test-and-build-workflow.yml', match:'OPENSEARCH_PLUGIN_VERSION: \\d+.\\d+.\\d+.\\d+', replace:'OPENSEARCH_PLUGIN_VERSION: ' + newVersion.tokenize('-')[0] + '.0', flags:'g', byline:true)
572+
ant.replaceregexp(file:'../.github/workflows/draft-release-notes-workflow.yml', match:'version: \\d+.\\d+.\\d+.\\d+', replace:'version: ' + newVersion.tokenize('-')[0] + '.0', flags:'g', byline:true)
573+
// Match key version in JSON files.
574+
ant.replaceregexp(file:'../dashboards-reports/opensearch_dashboards.json', match:'"version": "\\d+.\\d+.\\d+.\\d+', replace:'"version": ' + '"' + newVersion.tokenize('-')[0] + '.0', flags:'g', byline:true)
575+
ant.replaceregexp(file:'../dashboards-reports/package.json', match:'"version": "\\d+.\\d+.\\d+.\\d+', replace:'"version": ' + '"' + newVersion.tokenize('-')[0] + '.0', flags:'g', byline:true)
576+
// Match key opensearchDashboardsVersion in JSON files.
577+
ant.replaceregexp(file:'../dashboards-reports/opensearch_dashboards.json', match:'"opensearchDashboardsVersion": "\\d+.\\d+.\\d+', replace:'"opensearchDashboardsVersion": ' + '"' + newVersion.tokenize('-')[0], flags:'g', byline:true)
578+
}
579+
}

0 commit comments

Comments
 (0)