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

Jenkins triggers wrong branch build.

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      Hi guys, i have a pipeline configuration like the image attached. But I got multiple branch builds triggered when merge from master to release branch. Jenkins triggered master job and release job at the same time.

      1. I have 3 branches: master/release/production
      2. Configuration on jobs with pipeline
      3. Reproduce
        • create PR 1 to merge into master, then merge it
        • create PR 2 to merge into master
        • create PR 3 to merge from master to release
        • Jenkins will trigger 4 jobs: master/release/production/default with GHPR builder instead of trigger 1 job of PR 2

      What i expect:

      • Jenkins trigger only 1 job of PR2
      • After i merge PR2, Jenkins trigger the job of branch master
      • After i merge PR 3, Jenkins trigger the job of branch release

      Thank you

        Attachments

          Activity

          tokio Quang Huynh created issue -
          tokio Quang Huynh made changes -
          Field Original Value New Value
          Description Hi guys, i have a pipeline configuration like the image attached. But I got multiple branch builds triggered when merge from master to release branch. Jenkins triggered master job and release job at the same time. Hi guys, i have a pipeline configuration like the image attached. But I got multiple branch builds triggered when merge from master to release branch. Jenkins triggered master job and release job at the same time.

          How can I configure to trigger one branch build only ?
          Thank you
          tokio Quang Huynh made changes -
          Description Hi guys, i have a pipeline configuration like the image attached. But I got multiple branch builds triggered when merge from master to release branch. Jenkins triggered master job and release job at the same time.

          How can I configure to trigger one branch build only ?
          Thank you
          Hi guys, i have a pipeline configuration like the image attached. But I got multiple branch builds triggered when merge from master to release branch. Jenkins triggered master job and release job at the same time.

          1. have three branches: master/release/production
          2. two PRs: 1 from to master, 1 from master to release

          How can I configure to trigger one branch build only ?
           Thank you
          tokio Quang Huynh made changes -
          Attachment Screenshot from 2017-12-04 16.23.22.png [ 40570 ]
          tokio Quang Huynh made changes -
          Attachment Configuration for master.png [ 40571 ]
          Attachment Configuration for release.png [ 40572 ]
          tokio Quang Huynh made changes -
          Description Hi guys, i have a pipeline configuration like the image attached. But I got multiple branch builds triggered when merge from master to release branch. Jenkins triggered master job and release job at the same time.

          1. have three branches: master/release/production
          2. two PRs: 1 from to master, 1 from master to release

          How can I configure to trigger one branch build only ?
           Thank you
          Hi guys, i have a pipeline configuration like the image attached. But I got multiple branch builds triggered when merge from master to release branch. Jenkins triggered master job and release job at the same time.

          1. have three branches: master/release/production
           2. two PRs: 1 from to master, 1 from master to release

          How can I configure to trigger one branch build only

          E.g: If i create PR from master to release, it only triggers release job not both release and master job.


           Thank you
          tokio Quang Huynh made changes -
          Description Hi guys, i have a pipeline configuration like the image attached. But I got multiple branch builds triggered when merge from master to release branch. Jenkins triggered master job and release job at the same time.

          1. have three branches: master/release/production
           2. two PRs: 1 from to master, 1 from master to release

          How can I configure to trigger one branch build only

          E.g: If i create PR from master to release, it only triggers release job not both release and master job.


           Thank you
          Hi guys, i have a pipeline configuration like the image attached. But I got multiple branch builds triggered when merge from master to release branch. Jenkins triggered master job and release job at the same time.

          1. have three branches: master/release/production
           2. two PRs: 1 from to master, 1 from master to release
          3. six reproduces:
          - create PR 1 to merge into master, then merge it
          - create PR 2 to merge into master
          - create PR 3 to merge from master to release
          - Jenkins will trigger 4 jobs: master/release/production/default with GHPR builder instead of trigger 1 job of PR 2



          How can I configure to trigger one branch build only

          E.g: If i create PR from master to release, it only triggers release job not both release and master job.

          Thank you
          portlet Thang Nguyen made changes -
          Description Hi guys, i have a pipeline configuration like the image attached. But I got multiple branch builds triggered when merge from master to release branch. Jenkins triggered master job and release job at the same time.

          1. have three branches: master/release/production
           2. two PRs: 1 from to master, 1 from master to release
          3. six reproduces:
          - create PR 1 to merge into master, then merge it
          - create PR 2 to merge into master
          - create PR 3 to merge from master to release
          - Jenkins will trigger 4 jobs: master/release/production/default with GHPR builder instead of trigger 1 job of PR 2



          How can I configure to trigger one branch build only

          E.g: If i create PR from master to release, it only triggers release job not both release and master job.

          Thank you
          Hi guys, i have a pipeline configuration like the image attached. But I got multiple branch builds triggered when merge from master to release branch. Jenkins triggered master job and release job at the same time.
           # I have 3 branches: master/release/production
           # Configuration on jobs with pipeline
           ** configuration for master [https://gyazo.com/e7e34ad74ee9aa0bf765f6d556fa73d6]
           ** configuration for release [https://gyazo.com/be4b72a963ca61a3ca8724223200a24d]
           ** configuration uses to listen PR hook with Jenkins PR builder plugin [https://gyazo.com/b97e7d5aa366afc57c4dafdf31c78163]
           # Reproduce
           ** create PR 1 to merge into master, then merge it
           ** create PR 2 to merge into master
           ** create PR 3 to merge from master to release
           ** Jenkins will trigger 4 jobs: master/release/production/default with GHPR builder instead of trigger 1 job of PR 2

          What i expect:

          - Jenkins trigger only 1 job of PR2
          - After i merge PR2, Jenkins trigger the job of branch master
          - After i merge PR 3, Jenkins trigger the job of branch release

          Thank you
          portlet Thang Nguyen made changes -
          Labels git git-plugin pullrequestbuilder
          tulasinadh tulasinadh vaka made changes -
          Assignee tulasinadh vaka [ tulasinadh ]
          tulasinadh tulasinadh vaka made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          Hide
          tulasinadh tulasinadh vaka added a comment -

          Hi Quang Huynh

          I had gone through your scenario. First two screen shots seems to be fine.

          In the third one you mentioned branch as ${sha1}, instead of that of you specify branch name as PR* it'll trigger the build for those specific branches starting with PR

          I hope this can fix issue.

          Show
          tulasinadh tulasinadh vaka added a comment - Hi Quang Huynh I had gone through your scenario. First two screen shots seems to be fine. In the third one you mentioned branch as ${sha1}, instead of that of you specify branch name as PR* it'll trigger the build for those specific branches starting with PR I hope this can fix issue.
          tulasinadh tulasinadh vaka made changes -
          Status In Progress [ 3 ] In Review [ 10005 ]
          tulasinadh tulasinadh vaka made changes -
          Assignee tulasinadh vaka [ tulasinadh ] Quang Huynh [ tokio ]

            People

            • Assignee:
              tokio Quang Huynh
              Reporter:
              tokio Quang Huynh
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: