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

P4 - Additional build occurs

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      p4 plugin: 1.10.12

       

      It is a multibranch pipeline project with Helix Streams as its source. See the attached screen shot (multi_pipeline.png).

       

      I have the following trigger, so the trigger will be fired only when there is a submit to //stream/Dev-A/…

       

      $ p4 triggers -o | grep -v “^#”

      Triggers:

           jenkins change-commit //stream/Dev-A/... “%//depot/jdepot.sh% %change%”

       

      jdepot.sh is attached.

       

      However, in the following steps, a Jenkins job for another stream path, //stream/Dev-B/… is also fired. 

      • A submit is made to //stream/Dev-B/…
      • No Jenkins job is fired since the submit was not for //stream/Dev-A/…, which is expected.
      • A submit is made to //stream/Dev-A/…
      • A Jenkins job for //stream/Dev-A/… is fired, which is expected.
      • However, a Jenkins job for //stream/Dev-B/… which was previously submitted is also fired.

       

      Jenkinsfile for //stream/Dev-A/… and //stream/Dev-B/… are attached. See Jenkins_Dev-A and Jenkins_Dev-B.

        Attachments

        1. multi_pipeline.png
          multi_pipeline.png
          97 kB
        2. jdepot.sh
          0.3 kB
        3. Jenkinsfile_Dev-B
          0.6 kB
        4. Jenkinsfile_Dev-A
          0.6 kB

          Activity

          Hide
          p4karl Karl Wirth added a comment -

          Hi Kevin Park

          The Perforce trigger you are using tells all jobs to wake up and check if they need to be built. Therefore any job that has:

          triggers { p4Trigger() } 
          

          will wake up and check if it needs to be built. In your case there are new changes so it will run the build.

          If you are after a more targeted build you need to remove the 'triggers' line above from your pipeline script and call the direct URL for the job in your Perforce trigger. For example:

          http://MyJenkinsServer:8080/job/MyJobName/job/MyBranchName/build?delay=0sec
          

           

           

          Show
          p4karl Karl Wirth added a comment - Hi Kevin Park The Perforce trigger you are using tells all jobs to wake up and check if they need to be built. Therefore any job that has: triggers { p4Trigger() } will wake up and check if it needs to be built. In your case there are new changes so it will run the build. If you are after a more targeted build you need to remove the 'triggers' line above from your pipeline script and call the direct URL for the job in your Perforce trigger. For example: http: //MyJenkinsServer:8080/job/MyJobName/job/MyBranchName/build?delay=0sec    

            People

            Assignee:
            p4karl Karl Wirth
            Reporter:
            s3037560 Kevin Park
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated: