Skip to content

Commit

Permalink
Staging for version increment automation (opensearch-project#409) (op…
Browse files Browse the repository at this point in the history
…ensearch-project#468)

* 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 0f0ba16)
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 84996db commit adfff8e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -703,3 +703,14 @@ mixedCluster {
systemProperty 'cluster.mixed', "$mixedClusterFlag"
systemProperty 'cluster.number_of_nodes', "${_numNodes}"
}

// 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)
}
}

0 comments on commit adfff8e

Please sign in to comment.