For a while now, I've been cracking my head on how to implement gitflow with maven into Bamboo, while not giving up Bamboo's great features like plan branches and deployment projects.
I'll sketch our environment first, before going to ask questions.
- The 'master' branch contains the latest version in production, so no SNAPSHOT version.
- The 'develop' branch is used for development. All feature branches branch from 'develop' and merge back into 'develop'. This branch runs on a SNAPSHOT version.
- The 'release/xxx' branch is branched from 'develop' and gets a -RCx version. So here, no SNAPSHOT anymore.
- We use Artifactory to store all our 'released' and SNAPSHOT jar files.
Because the jgitflow-release-plugin seems to be messed up and does things weirdly, we've written our own release plugin for maven. It basically has 3 goals:
- start-release: creates a 'release/xxx' branch from 'develop' and sets the version to 'x.x.x-RC1'
- bump-release: checks out the 'release/xxx' branch and bumps the -RCx version. (For example, from -RC1 to -RC2)
- finish-release: checks out the 'release/xxx' branch, sets the version to x.x.x, merges to 'master', tags, updates the version 'release/xxx' branch to y.y.y and merges into develop.
This plugin works great, if you run it manually on your pc. But if I want to configure it on Bamboo, I seem to fail the configuration.
Here are a few of our requests:
- Automatically build and deploy (maven deploy to Artifactory) on a commit of the 'develop' and 'master' branch but not on the 'release/xxx', 'bugfix/xxx', 'feature/xxx' and 'hotfix/xxx' branches.
- Automatically build on the 'release/xxx' branch. With a manual stage we could do the 'bump-release' and 'deploy' goal.
- Manually start a release (so execute the 'finish-release' goal) without the need of bumping the version first.
- Allow one-click releases via JIRA.
We have tried using the default maven-release-plugin on a manual stage, and execute it only on the 'master' branch, but this updates the version to SNAPSHOT (which we don't want on the 'master' branch), and we are unable to use the -RC versions in the 'release/xxx' branches.
Ideally what we've been thinking, is that there should be the ability to 'override' branch configuration. So that one type of branch does Stage A, Stage B and Stage C, while other branches execute Stage A, Stage C and Stage D. Also, the ability to add 2 manual (only manual) stages which are executed in a XOR pattern. So first Stage A, then Stage B1 XOR Stage B2 and then back to Stage C.
So for the question, is there a way to configure our requests in Bamboo, without having to configure 3 different project plans and over complicating things?