Search code examples
jenkinspipelinemultibranch-pipeline

Jenkins build multibranch pipeline from another multibranch pipeline


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?


Solution

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

    job: "multibranchPipeleB/master"