pipeline { agent any environment { NEXT_VERSION = nextVersion() } stages { stage('Hello') { steps { echo "next version = ${NEXT_VERSION}" } } } }
Goal:Automatically determine the next semantic version for a repository
Status:Completed
As the CI/CD world is moving more towards automation and minimal human interaction, the ability to fully automate a release, including the determination of the "next" release version becomes desirable.
Semantic/Conventional commits is one way of programmatically understanding the changes made between releases
为an existing project released at1.0.0
, the following commit messages would bump the version as follows:
Commit Message | Next Version |
---|---|
|
|
|
|
|
|
|
|
The conventional commits plugin is a Jenkins plugin to automatically determine the next semantic version for a git repository using the Conventional Commits (C.C) system.
Taking in various sources of input, like the commit history of the repository, the latest tagged version, and the version information read from various configuration files of the project, the plugin outputs the next semantic version.
The plugin is best used in a Jenkins Pipeline Project.
为example:
pipeline { agent any environment { NEXT_VERSION = nextVersion() } stages { stage('Hello') { steps { echo "next version = ${NEXT_VERSION}" } } } }
More examples for the Declarative and the Scripted Pipeline can be found in the project’sREADME.
为more details please see the following Resources section.
The code for Conventional Commits Plugin can be foundhere on Github.Note: The project is under active development.
The roadmap for the future can be foundhere.