Skip to content

Commit

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

* 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 366bf16)
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>
Signed-off-by: AWSHurneyt <hurneyt@amazon.com>
  • Loading branch information
2 people authored and AWSHurneyt committed Feb 29, 2024
1 parent b34e23c commit 281bb54
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 @@ -195,3 +195,15 @@ publishing {
gradle.startParameter.setShowStacktrace(ShowStacktrace.ALWAYS)
gradle.startParameter.setLogLevel(LogLevel.DEBUG)
}

// 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 281bb54

Please sign in to comment.