Skip to content

Commit f533e21

Browse files
Staging for version increment automation (opensearch-project#409) (opensearch-project#433)
* 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> Co-authored-by: Prudhvi Godithi <pgodithi@amazon.com>
1 parent cb29e16 commit f533e21

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

build.gradle

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -703,3 +703,14 @@ mixedCluster {
703703
systemProperty 'cluster.mixed', "$mixedClusterFlag"
704704
systemProperty 'cluster.number_of_nodes', "${_numNodes}"
705705
}
706+
707+
// updateVersion: Task to auto increment to the next development iteration
708+
task updateVersion {
709+
onlyIf { System.getProperty('newVersion') }
710+
doLast {
711+
ext.newVersion = System.getProperty('newVersion')
712+
println "Setting version to ${newVersion}."
713+
// String tokenization to support -SNAPSHOT
714+
ant.replaceregexp(file:'build.gradle', match: '"opensearch.version", "\\d.*"', replace: '"opensearch.version", "' + newVersion.tokenize('-')[0] + '-SNAPSHOT"', flags:'g', byline:true)
715+
}
716+
}

0 commit comments

Comments
 (0)