Jenkins: Trigger Multi-branch pipeline on upstream change

后端 未结 3 2032
离开以前
离开以前 2020-12-13 00:51

I am currently testing the pipeline approach of Jenkins 2.0 to see if it works for the build environment I am using.

First about the environment itself. It currently

3条回答
  •  爱一瞬间的悲伤
    2020-12-13 01:12

    If you're using a declarative multi-branch pipeline, you can use:

    triggers {
      upstream(upstreamProjects: "some_project/some_branch", threshold: hudson.model.Result.SUCCESS)
    }
    

    If you wish for branch matching to occur across dependencies you can use:

    triggers {
      upstream(upstreamProjects: "some_project/" + env.BRANCH_NAME.replaceAll("/", "%2F"), threshold: hudson.model.Result.SUCCESS)
    }
    

提交回复
热议问题