@@ -10,7 +10,7 @@ import org.opensearch.gradle.testclusters.StandaloneRestIntegTestTask
1010buildscript {
1111 ext {
1212 opensearch_group = " org.opensearch"
13- opensearch_version = System . getProperty(" opensearch.version" , " 1.3.4 -SNAPSHOT" )
13+ opensearch_version = System . getProperty(" opensearch.version" , " 1.3.5 -SNAPSHOT" )
1414 // 1.0.0 -> 1.0.0.0, and 1.0.0-SNAPSHOT -> 1.0.0.0-SNAPSHOT
1515 opensearch_build = opensearch_version. replaceAll(/ (\.\d )([^\d ]*)$/ , ' $1.0$2' )
1616 common_utils_version = System . getProperty(" common_utils.version" , opensearch_build)
@@ -524,3 +524,21 @@ if (!usingRemoteCluster && !usingMultiNode) {
524524}
525525
526526apply from : ' build-tools/pkgbuild.gradle'
527+
528+ // updateVersion: Task to auto increment to the next development iteration
529+ task updateVersion {
530+ onlyIf { System . getProperty(' newVersion' ) }
531+ doLast {
532+ ext. newVersion = System . getProperty(' newVersion' )
533+ println " Setting version to ${ newVersion} ."
534+ // String tokenization to support -SNAPSHOT
535+ ant. replaceregexp(file :' build.gradle' , match : ' "opensearch.version", "\\ d.*"' , replace : ' "opensearch.version", "' + newVersion. tokenize(' -' )[0 ] + ' -SNAPSHOT"' , flags :' g' , byline :true )
536+ 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 )
537+ 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 )
538+ // Match key version in JSON files.
539+ ant. replaceregexp(file :' ../dashboards-reports/opensearch_dashboards.json' , match :' "version": "\\ d+.\\ d+.\\ d+.\\ d+' , replace :' "version": ' + ' "' + newVersion. tokenize(' -' )[0 ] + ' .0' , flags :' g' , byline :true )
540+ ant. replaceregexp(file :' ../dashboards-reports/package.json' , match :' "version": "\\ d+.\\ d+.\\ d+.\\ d+' , replace :' "version": ' + ' "' + newVersion. tokenize(' -' )[0 ] + ' .0' , flags :' g' , byline :true )
541+ // Match key opensearchDashboardsVersion in JSON files.
542+ ant. replaceregexp(file :' ../dashboards-reports/opensearch_dashboards.json' , match :' "opensearchDashboardsVersion": "\\ d+.\\ d+.\\ d+' , replace :' "opensearchDashboardsVersion": ' + ' "' + newVersion. tokenize(' -' )[0 ], flags :' g' , byline :true )
543+ }
544+ }
0 commit comments