Determine the next release version based on previous tags and the commit messages used. It calculates the version number based on the format of the commit message. The commit message format used is conventional commits.
This plugin can be used in a pipeline in a stage or the environment block. Some examples of this in use are:
In the environment block:
In a scripted Pipeline:
pipeline {
agent any
environment {
NEXT_VERSION = nextVersion()
}
stages {
stage('Hello') {
steps {
echo "next version = ${NEXT_VERSION}"
}
}
}
}
def NEXT_VERSION
node {
stage('Get next version ...') {
NEXT_VERSION=nextVersion()
echo "Next version : $NEXT_VERSION"
}
stage ('Release') {
sh "mvn release:prepare -DreleaseVersion=$NEXT_VERSION"
sh 'mvn release:perform'
}
}