Skip to content

Commit

Permalink
add devops az templates
Browse files Browse the repository at this point in the history
  • Loading branch information
pasqualespica committed Jul 12, 2022
1 parent 432dbab commit fc0652e
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .devops/azure-templates/maven-versioning.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Upgrades the version numbers as reported in pom files

parameters:
# Versioning parameters
- name: 'semver'
type: string
values:
- major
- minor
- patch
- buildNumber
- skip

steps:
- ${{ if eq(parameters.semver, 'patch') }}:
- task: Maven@3
inputs:
mavenPomFile: "pom.xml"
goals: 'build-helper:parse-version versions:set'
options: '-DnewVersion=${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.nextIncrementalVersion}'
- ${{ if eq(parameters.semver, 'minor') }}:
- task: Maven@3
inputs:
mavenPomFile: "pom.xml"
goals: 'build-helper:parse-version versions:set'
options: '-DnewVersion=${parsedVersion.majorVersion}.${parsedVersion.nextMinorVersion}.0'
- ${{ if eq(parameters.semver, 'major') }}:
- task: Maven@3
inputs:
mavenPomFile: "pom.xml"
goals: 'build-helper:parse-version versions:set'
options: '-DnewVersion=${parsedVersion.nextMajorVersion}.0.0'
- ${{ if eq(parameters.semver, 'buildNumber') }}:
- task: Maven@3
inputs:
mavenPomFile: "pom.xml"
goals: 'build-helper:parse-version versions:set'
options: '-DnewVersion=${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}-${parsedVersion.nextBuildNumber}'

0 comments on commit fc0652e

Please sign in to comment.