The conventional commits plugin is a Google Summer of Code project. Special thanks to the mentors Gareth Evans, Kristin Whetstone, Olivier Vernin and Allan Burdajewicz.
What are Conventional Commits
According to the official website, conventonal commits are, "A specification for adding human and machine readable meaning to commit messages."
Conventional commits are a lightweight convention on top of commit messages.
The following table shows major structural elements offered by the conventional commits convention.
Structural Element | Example | |
---|---|---|
Chore |
| |
Fix |
| |
Feat |
| |
Breaking Change |
|
Commit Message | Version Bump | SemVer Equivalent |
---|---|---|
|
| No version bump |
|
| Increment in the patch version |
|
| Increment in the minor version |
|
| Increment in the major version |
Project Type | Configuration File(s) Read |
---|---|
Maven | pom.xml |
Gradle | build.gradle |
Make | Makefile |
Python | setup.py setup.cfg pyproject.toml |
Helm | Charts.yml |
Node (NPM) | package.json |
How to use the plugin
Recommended way of using the plugin is to add a step in a Jenkins Pipeline Project.
nextVersion()
is the pipeline step to be used.
For example:
pipeline {
agent any
environment {
NEXT_VERSION = nextVersion()
}
stages {
stage('Hello') {
steps {
echo "next version = ${NEXT_VERSION}"
}
}
}
}
Tip: The pipeline step can also be generated with the help of the Snippet Generator.Please select "nextVersion" in the Sample Step drop down and then click on "Generate Pipeline Snippet"
The plugin is released on every feature using JEP-229.
The plugin is available to download from the plugins site.
Next Steps
Support for pre-release information. Example:
1.0.0-alpha
,1.0.0-beta
, etcSupport for build metadata. Example:
1.0.0-beta+exp.sha.5114f85
Optionally writing the calcuated "Next Version" into the project’s configuration file. Example:
pom.xml
for a maven project,setup.py
for python.
Feedback
We would love to hear your feedback & suggestions for the plugin.
Please reach out on the plugin’s GitHub repository, the Gitter channel or start a discussion on community.jenkins.io.