0

I'm on a project that uses Mulesofts Anypoint studio for API development. Anypoint studio uses Maven to build its projects and handle versioning. Currently we are using a Git-flow branching model without release branches (feature/development/master) and the CI tool is Jenkins. We want to migrate to Azure-DevOps with Trunk-based branching.

The current git-flow CI set-up works as follows:

  1. Merge feature with Dev
  2. Jenkins triggers on Dev and builds a package with Maven
  3. Jenkins deploys the package to D
  4. Test your API on the D, if its good manually trigger Jenkins release pipeline
  5. Jenkins will merge dev with master
  6. Maven creates a release; creating a package (e.g. v0.1) and prepare the next development iteration (v0.2-SNAPSHOT) in master
  7. Jenkins Deploys the package on A and P
  8. Merge master back into Dev

So we have 2 separate pipelines here: dev and release. I'm hoping trunk-based development makes this process simpler by reducing it to one pipeline that is triggered by merges into master. But I don't know how to handle the versioning with Maven here.

This is what I have in mind for the Trunk-based (feature/master) pipeline:

  1. Merge feature with Master
  2. Azure pipelines triggers Maven release
  3. (!) Maven takes the 0.1-SNAPSHOT version and creates a 0.1 release version and puts it..where? in a release branch?
  4. Maven then creates the next working version 0.2-SNAPSHOT on the master branch
  5. (!) this would trigger Azure pipelines again, creating a loop

Anyone have experience with Trunk Based development with Maven solve this? I would actually prefer to do it without a release branch because the released packages are already providing the release-branch functionality.

At first glance this answer seemingly solves my issue, but it just ignores the issue by going around it and just using a hash.

Leo Liu
  • 71,098
  • 10
  • 114
  • 135
Herman
  • 750
  • 1
  • 10
  • 23

0 Answers0