01-Jun-2021 - Jenkins
01-Jun-2021 - Jenkins
01-Jun-2021 - Jenkins
Multibranch pipeline
-------------------------
When developer creates code for multiple functionalities, he will generally do
that on separate branches.
Every branch will contains specific code related to one functionality.
Along with the code, the developer will also create separate jenkins file for every
branch.
This jenkins file will contain the stages of CI-CD, that should be performed on
that branch.
All these branches along with jenkins file will be uploaded by into the github
repository.
We should create a jenkins job, which will work on these branches parallely and
execute the steps present in different jenkins files.
$ mkdir multibranch
$ cd multibranch
node('master')
stage('ContinuousDownload_master')
{
git 'https://github.com/sunildevops77/maven.git'
}
stage('Continuousbuild_master')
{
sh label: '', script: 'mvn package'
}
:wq
(Onservation, we have done the changes in master branch )
$ git add .
$ git commit -m "b"
node('master')
stage('ContinuousDownload_loans')
{
git 'https://github.com/sunildevops77/maven.git'
}
stage('Continuousbuild_loans')
{
sh label: '', script: 'mvn package'
}
:wq
$ git add .
$ git commit -m "c"
Login to jenkins
New item -- MultiBranchPipeline
Select multibranch Pipeline
Branch Sources
Add source
Git
Project Repository -- https://github.com/sunildevops77/Jenkins_multiBranch24.git
Lets say, developer will make changes and push to the repostitory
++++++++++++++++++++++++++++++++++++++++++