Search code examples
javagitjenkinsgit-flowjgitflow-maven-plugin

Git flow: How to configure a one-click release process in Jenkins?


We are using the standard git flow branching model (develop, master, release-, hotfix-, etc).

As part of our workflow, we would like to set up a "one-click" release via jenkins.

I was looking at the jgitflow-maven-plugin. Can I set up this plugin to do a one-click release from jenkins? If so, what are the configuration options?

In particular, can I do something like this?

Jenkins Job
Maven goals:    release-start release-finish -Dsomething -Delse

And is there a way tell it to automatically build from the latest -SNAPSHOT version, e.g. if the version is 1.2.3-SNAPSHOT it would build release-1.2.3.

Otherwise, is there a maven plugin that builds releases according the git flow branching model (i.e. build from develop and create a new release branch named release-x.y.z).


Solution

  • We never found a way to get this to work via a plugin or maven goal in Jenkins.

    Our solution ended up with a bash script that did git flow release start <version>, maven release process, git flow release finish <version> and other things (git pull on develop and master at very start, git push and slack notification at very end).