Conventional Commits plugin for Jenkins

Goal: Automatically determine the next semantic version for a repository

Status: Completed

Team

Details

Background

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

For an existing project released at 1.0.0, the following commit messages would bump the version as follows:

Commit Message Next Version

chore: improve logging

1.0.1

fix: minor bug fix

1.0.1

feat: add a new feature

1.1.0

BREAKING CHANGE: reimplement

2.0.0

Project Details

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.

For 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’s README.

For more details please see the following Resources section.

Resources

Getting the Code

The code for Conventional Commits Plugin can be found here on Github. Note: The project is under active development.

Roadmap

The roadmap for the future can be found here.

Links