简体   繁体   中英

Jenkins Pipeline: How to build job build after multibranch project is built?

Is it possible to define Build after other projects are built for Pipeline Multibranch , especially for org. folders like GitHub Organization or Bitbucket Tream/Project ?

Example:

properties([pipelineTriggers([upstream(
        threshold: hudson.model.Result.SUCCESS,         
        upstreamProjects: "../multibranch-job/master")])])

Does it work? Does it require absolute or relative path?

Apparently Build after other projects are built works just fine either with generic Pipeline, Multibranch, or Org. Folders like Bitbucket Team/Project.

My problem was related to the fact that I was referring to job with incorrect path.

Absolute Path:

An absolute path could be always found out in the upper section of job screen. This is especially useful if name contains special characters which might be replaced by Jenkins.

在此输入图像描述

Thus the properties step should look:

properties([pipelineTriggers([upstream(
        threshold: hudson.model.Result.SUCCESS,         
        upstreamProjects: "t/multibranch-job-to-be-triggered/feature%2Ftest")])])

Relative Path:

Beside absolute path, you can refer to job with relative paths, ex:

  • another-branch
  • ../another-job/branch

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM