0

I create a Jenkins job with multibranch pipeline, and triggered by develop and PR-* branches.

By setting strategy to "All branches" and "Discover pull requests from origin" to "Merging the pull request with the current target branch revision", I can build when

  • new commit in develop branch, develop branch pipeline triggered.

  • PR open (develop <- feature/aaa), PR build with code which merged develop and feature/aaa branch

  • new commit in feature/aaa branch, PR build with code with merged develop and new feature/aaa branch

But when new commit in develop, there is no trigger in opened pull request (which merge target is develop)'s pipeline.

I want to re-build in PR-123 when develop branch updated.

How can I triggering the Pull Request job when target branch updated?

Any idea how to do or if it's actually possible?

juny
  • 3
  • 2

1 Answers1

0

https://stackoverflow.com/a/60006988/1437758 might help.

There is an additional approach:

triggers {
    upstream env.BRANCH_NAME != 'develop' ? 'develop' : ''
}

This will set up a trigger between the upstream (develop) and downstream builds (PR-*)

xwandi
  • 114
  • 1
  • 8