Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-68261

Delay automatic rebuilding when a commit is pushed on master/upstream

XMLWordPrintable

      Hello,

      I currently have a multibranch pipeline on Jenkins which rebuilds all of the open PRs (and aborts the running builds) when a commit is pushed to master (i.e. when a branch is merged).

      However, I have an optional stage which allows me to run some tests in the PRs. These tests can take up to several hours

      Ideally, once a commit is pushed to master, I would like to wait for these optional tests on the PRs to be over before rebuilding all of the PRs, in order not to abort them.

      At first, I thought of a read-write lock using temporary files on my workspace. However, this won't work since the PRs are rebuilded before entering the Jenkinsfile.

      The best I could find was the "Ignore rebuilding merge branches when only the target branch changed" option from Basic Branch Build Strategies but this simply prevents the PR rebuilds, instead of delaying them.

      Do you have any ideas about a possible workaround for this? Any help would be greatly appreciated.

            Unassigned Unassigned
            kevs_937 Kevin Mt
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: