0

I'm messing around with a multibranch pipeline in jenkins. Currently we have zero pipelines in production and everything is using freestyle jobs which is very sloppy. I have my own multibranch pipeline using my name to get my branches, checking which ones have a Jenkinsfile. I'm sure there's no one great answer to this, but what is the general use of a multibranch pipeline? Do people create one per user? What is your current or your favorite setup for this?

If this isn't the place to ask a "best practice" question, please point me to a devops forum or somewhere that I might be able to ask this.

0

Multi branch pipelines work great when your are using the git flow method: https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow

We define one multi branch pipeline per application. There is one pipeline documentation for all branches. Based on the branch name different artifacts are build in the end.

  • Main branch builds release artifacts. This could be replaced with builds on git Tag events. The release artifacts will be deployed by fixed version numbers to the test and production environment.
  • Develop branch builds Snapshot artifacts. Those will be deployed by using latest to the develop environment.
  • Feature branches build also Snapshot artifacts which can be deployed to the dev environment as well.

All commit events on all branches run lint, unit test, SAST, dependency scan checks before the artifact is pushed to the artifactory. This guarantees that you don’t have to remediate a lot of findings after merging into the develop or main branch. Using different artifactories helps you reduce storage costs because you can just delete all Snapshot artifacts after 30 days.

Feel free to ask for specific details.

Cheers!

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.