@@ -488,3 +488,21 @@ if (!usingRemoteCluster && !usingMultiNode) {
488
488
}
489
489
490
490
apply from : ' build-tools/pkgbuild.gradle'
491
+
492
+ // updateVersion: Task to auto increment to the next development iteration
493
+ task updateVersion {
494
+ onlyIf { System . getProperty(' newVersion' ) }
495
+ doLast {
496
+ ext. newVersion = System . getProperty(' newVersion' )
497
+ println " Setting version to ${ newVersion} ."
498
+ // String tokenization to support -SNAPSHOT
499
+ ant. replaceregexp(file :' build.gradle' , match : ' "opensearch.version", "\\ d.*"' , replace : ' "opensearch.version", "' + newVersion. tokenize(' -' )[0 ] + ' -SNAPSHOT"' , flags :' g' , byline :true )
500
+ 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 )
501
+ 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 )
502
+ // Match key version in JSON files.
503
+ ant. replaceregexp(file :' ../dashboards-reports/opensearch_dashboards.json' , match :' "version": "\\ d+.\\ d+.\\ d+.\\ d+' , replace :' "version": ' + ' "' + newVersion. tokenize(' -' )[0 ] + ' .0' , flags :' g' , byline :true )
504
+ ant. replaceregexp(file :' ../dashboards-reports/package.json' , match :' "version": "\\ d+.\\ d+.\\ d+.\\ d+' , replace :' "version": ' + ' "' + newVersion. tokenize(' -' )[0 ] + ' .0' , flags :' g' , byline :true )
505
+ // Match key opensearchDashboardsVersion in JSON files.
506
+ ant. replaceregexp(file :' ../dashboards-reports/opensearch_dashboards.json' , match :' "opensearchDashboardsVersion": "\\ d+.\\ d+.\\ d+' , replace :' "opensearchDashboardsVersion": ' + ' "' + newVersion. tokenize(' -' )[0 ], flags :' g' , byline :true )
507
+ }
508
+ }
0 commit comments