Introduction
In the modern CI/CD setup, we may require to create a Jenkins pipeline based on the branches which are available in the SCM (Source Code Management). For example, the developer needs a Jenkins pipeline for his own feature/bugfix branch which can build, test and prepare the code coverage report. Manually creating this Jenkins pipeline for the new branches is not an effective one. So, we need an automation, which should create the new Jenkins pipeline whenever the developer creates a new branch in SCM.
Jenkins Multibranch Pipeline
The Multibranch Pipeline allow us to automatically create a pipeline for each branch on our Source Code Management (SCM) repository with the help of Jenkinsfile.
How to setup Multibranch Pipeline in Jenkins
- Select New Item from Jenkins Dashboard
- Enter the project name in the Item name text box and select Multibranch Pipeline then click OK button.
- Select your version control software from the Build Source.
- Click Save Button
- Add the Jenkins file (It contains the stages of Jenkins pipeline) into the repository branch.
Jenkins File
The Jenkins file contains the information about the pipeline stages, It needs to be added in the SCM branches whereever we required the pipeline setup.
The sample Jenkins file is avaiable in the Github link
Comments
Post a Comment