Skip to content

Commit

Permalink
Staging for version increment automation (#391) (#418)
Browse files Browse the repository at this point in the history
* 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>
(cherry picked from commit 6667bfb)
Signed-off-by: prudhvigodithi <pgodithi@amazon.com>

Signed-off-by: pgodithi <pgodithi@amazon.com>
Signed-off-by: prudhvigodithi <pgodithi@amazon.com>
Co-authored-by: Prudhvi Godithi <pgodithi@amazon.com>
  • Loading branch information
1 parent 072ac50 commit 7824d2c
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions reports-scheduler/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -488,3 +488,21 @@ if (!usingRemoteCluster && !usingMultiNode) {
}

apply from: 'build-tools/pkgbuild.gradle'

// 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(file:'build.gradle', match: '"opensearch.version", "\\d.*"', replace: '"opensearch.version", "' + newVersion.tokenize('-')[0] + '-SNAPSHOT"', flags:'g', byline:true)
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)
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)
// Match key version in JSON files.
ant.replaceregexp(file:'../dashboards-reports/opensearch_dashboards.json', match:'"version": "\\d+.\\d+.\\d+.\\d+', replace:'"version": ' + '"' + newVersion.tokenize('-')[0] + '.0', flags:'g', byline:true)
ant.replaceregexp(file:'../dashboards-reports/package.json', match:'"version": "\\d+.\\d+.\\d+.\\d+', replace:'"version": ' + '"' + newVersion.tokenize('-')[0] + '.0', flags:'g', byline:true)
// Match key opensearchDashboardsVersion in JSON files.
ant.replaceregexp(file:'../dashboards-reports/opensearch_dashboards.json', match:'"opensearchDashboardsVersion": "\\d+.\\d+.\\d+', replace:'"opensearchDashboardsVersion": ' + '"' + newVersion.tokenize('-')[0], flags:'g', byline:true)
}
}

0 comments on commit 7824d2c

Please sign in to comment.