@@ -559,3 +559,21 @@ if (!usingRemoteCluster && !usingMultiNode) {
559
559
}
560
560
561
561
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