0

We have a "blessed" repository, and every team forks this repository with auto-sync enabled (blessed -> fork). In their own forked repo, the team creates their feature branches. Then they make a pull request towards the main branch on the blessed repository. Because of the auto-sync, they cannot change the pipeline configuration in their own repo. We would like Jenkins to limit the pull request discovery to pull requests originating from only one fork of one team. How can we do this.

Hmbucker
  • 115
  • 2
  • 10

1 Answers1

0

Forks are effectively separate repositories - they have different paths, different ownership, and different permissions, even though they have some shared code history.

If you're having Bitbucket send webhooks to Jenkins to trigger builds, then remove that configuration for any fork that should not have it. If you're having Jenkins poll for updates, then update Jenkins so that it only polls on the fork(s) that should build through Jenkins. And if you're moving to Pipelines, then the Pipelines YAML is distinct for each fork.

Jim Redmond
  • 4,139
  • 1
  • 14
  • 18
  • Hey Jim, thanks for your comment. Can you clarify "then remove that config for any fork..." we need PR builds that still occur on the non-pipeline Jenkins? – Hmbucker Dec 07 '17 at 10:07
  • You'll need to be more specific about what you want, but basically, since every fork is distinct from each other fork you should be able to update your configurations on one without disturbing the others. – Jim Redmond Dec 07 '17 at 20:38
  • I've rephrased my question a bit, hope it's more clear now. On another note, we are using Blue Ocean pipelines (not Bitbucket pipelines) – Hmbucker Dec 08 '17 at 12:42