0

I have Jenkins setup with 2 multibranch pipeline which depend on each other let say multibranchPipelineA and multibranchPipelineB. I would like a job from multibranchPipelineA to build specific branch in multibranchPipelineA and wait the build to finish

I have tried use below from multibranchPipeleA Jenkinfile

stage('Build MiniApp Libs') {
            steps {
                build(
                    job: "../multibranchPipeleB/master",
                    propagate: true,
                    wait: true
                )
            }
        }

But always receive No item named ../multibranchPipeleB/master found.

If I use single pipeline, let's say pipelineB, then the below work ../pipelineB

How can I build specific branch multibranchPipeline from another multibranchPipeline jobs? and wait the build to finish?

halfer
  • 19,824
  • 17
  • 99
  • 186
Lê Khánh Vinh
  • 2,591
  • 5
  • 31
  • 77

1 Answers1

0

To build another multibranchPipeline you do not need .. before its name. So in your case just use:

job: "multibranchPipeleB/master"

ymochurad
  • 941
  • 7
  • 15
  • hi thanks for your help, i have change to ```build( job: "ami-ph-android-gcashapp/master", propagate: true, wait: true )``` i still get error `No item named ami-ph-android-gcashapp/master` seem like jenkins cannot find the multibranch pipeline – Lê Khánh Vinh Dec 30 '20 at 08:30
  • 1
    When you open your multibranch pipeline and you branch in Jenkins UI, there should be a field named `Full project name: `. Does this name match with the name you are trying to build? – ymochurad Dec 30 '20 at 08:33
  • e.g. as on this screenshot: https://i.stack.imgur.com/2WAef.png – ymochurad Dec 30 '20 at 08:41
  • thanks, get it to work, my mistake is branch master is never been built that why jenkins can not find. i trigger a build on master from (multibranch piple to create master branch job) – Lê Khánh Vinh Dec 30 '20 at 08:44