Skip to content

Commit

Permalink
Staging for version increment automation (opensearch-project#197)
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>
  • Loading branch information
prudhvigodithi authored Aug 1, 2022
1 parent 6b8031d commit 62c5129
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -756,3 +756,22 @@ task runRally {
}
}
}

// versionIncrement: Task to auto increment to the next development iteration
task versionIncrement {
onlyIf { System.getProperty('newVersion') }
doLast {
ext.newVersion = System.getProperty('newVersion')
println "Setting version to ${newVersion}."
// String tokenization to support -SNAPSHOT
ant.replaceregexp(match: opensearch_version.tokenize('-')[0], replace: newVersion.tokenize('-')[0], flags:'g', byline:true) {
fileset(dir: projectDir) {
// Include the required files that needs to be updated with new Version
include(name: "INSTALL.md")
include(name: "docker/Dockerfile")
include(name: "src/main/resources/plugin-descriptor.properties")
}
}
ant.replaceregexp(file:'build.gradle', match: '"opensearch.version", "\\d.*"', replace: '"opensearch.version", "' + newVersion.tokenize('-')[0] + '-SNAPSHOT"', flags:'g', byline:true)
}
}

0 comments on commit 62c5129

Please sign in to comment.