I am using Jenkins Pipeline and have a scenario where the expectation is:
In the pipeline job 'Test A' - Stage 'Checkout_A' it calls other pipeline job 'Test B' - Stage 'Checkout_B' , after that stage in Test B is completed the controller should retun back to pipeline job 'Test A' and execute Stage ('Build_A') which again calls pipeline job 'Test B' - Stage ('Build_B') then controller should retun back to pipeline job 'Test A' and execute Stage ('Transfer_A').
1)Below is the syntax i am using but its not working as above expected, appricate your inputs on how to achive this approach.
2)I want to use this approach mainly to show the pipeline different stages in upstream job itself instead of in downstream job. Is there any way or plugin available to show the stages of downstream job along with upstream job flow.
Test A
_______
Stage ('Checkout_A')
build job: 'Test B, stage: 'Checkout_B'',
parameters: [string(name: 'GIT_URL', value: String.valueOf(ssh://git@xxx/aaa.git )),
string(name: 'CREDENTIALS', value: String.valueOf('xxxx123')
]
Stage ('Build_A')
build job: 'Test B, stage: 'Build_B',
parameters: [string(name: 'GIT_URL', value: String.valueOf(ssh://git@xxx/aaa.git )),
string(name: 'CREDENTIALS', value: String.valueOf('xxxx123')
]
Stage ('Transfer_A')
build job: 'Test B', Stage: 'Transfer_B'
Test B
________
stage 'Checkout_B'
git (url: '${GIT_URL}',
credentialsId: '${CREDENTIALS}')
build job: 'Test A, stage: Build_A'
Stage ('Build_B')
bat 'call "E:\\MSBuild\\12.0\\Bin\\MSBuild.exe" Sample.sln '
build job: 'Test A, stage: Transfer_A'
Stage ('Transfer_B')
Xcopy(Source, destination)