Skip to content

Commit

Permalink
Staging for version increment automation (#608)
Browse files Browse the repository at this point in the history
Signed-off-by: pgodithi <[email protected]>
(cherry picked from commit eb7bd07)
Signed-off-by: prudhvigodithi <[email protected]>
  • Loading branch information
prudhvigodithi authored and amitgalitz committed Aug 3, 2022
1 parent 101cbcc commit 7f4ecf5
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -792,3 +792,15 @@ if (printLogs) {
}
}
}

// 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
// Include the required files that needs to be updated with new Version
ant.replaceregexp(file:'build.gradle', match: '"opensearch.version", "\\d.*"', replace: '"opensearch.version", "' + newVersion.tokenize('-')[0] + '-SNAPSHOT"', flags:'g', byline:true)
}
}

0 comments on commit 7f4ecf5

Please sign in to comment.