Let us learn how to create multi branch pipeline using Jenkins.
What is Multi-branch pipeline?
- Automatically create new pipelines for every Git branch in source version control.
- Enables different pipeline implementation for every branch. for e.g let us say you want to have CICD pipeline for master branch and only CI pipeline for develop branch.
- an automatically discover new branches in the source control (GitHub or any SCM) and automatically create a pipeline for that branch.
Watch the steps in YouTube:
Create Jenkinsfile first
Please follow the link above to understand how to create Declarative pipeline - Jenkinsfile.
How to create multibranch pipeline?
Go to Jenkins. Create a new Item. give a name like myMultiBranchPipelineJob
Click ok
Click branch source, Add source, Add git.
Give your repo URL which has Jenkinsfile already.
Give your Git repo url, credentials. select credentials from the drop down.
Click apply and Save.
Now the pipeline job will automatically scan and creates pipeline per branch.
No comments:
Post a Comment