• Icon: Task Task
    • Resolution: Not A Defect
    • Icon: Critical Critical
    • p4-plugin

      Hi,

       

      I want to make jenkins pipeline job

      to run whenever commit comes.

       

      In checkout code, there's filter: [incremental(true)] feature like below.

      checkout perforce(
          credential: 'p4',
          filter: [incremental(true)],
          populate: syncOnly(...),
          workspace: templateSpec(...)
      )
      

      What is this for? 

       

      and there's polling build filters options in configuration page.

      What is this for?

      What is different with upper code ?

       

      Many thanks,

          [JENKINS-58456] explain polling per change

          Hokwang Lee created issue -
          Karl Wirth made changes -
          Attachment New: image-2019-07-12-08-35-27-798.png [ 47984 ]
          Karl Wirth made changes -
          Assignee New: Karl Wirth [ p4karl ]
          Karl Wirth made changes -
          Resolution New: Not A Defect [ 7 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]
          Karl Wirth made changes -
          Labels New: P4_SUPPORT
          Karl Wirth made changes -
          Attachment New: image-2019-09-02-16-25-39-289.png [ 48571 ]
          Karl Wirth made changes -
          Attachment New: image-2019-09-02-16-25-59-683.png [ 48572 ]
          Karl Wirth made changes -
          Attachment New: image-2019-09-02-16-26-19-383.png [ 48573 ]
          Karl Wirth made changes -
          Attachment New: image-2019-09-02-16-26-46-699.png [ 48574 ]
          Karl Wirth made changes -
          Comment [ Believe I have reproduced this. Reproduction steps:

          (1) Create a workspace in ws

          (2) Create files in "/ws/JENKINS-58639"

          (3) Created "/ws/JENKINS-58639/Jenkinsfile":
          {code:java}
          pipeline {
            options {
                  skipDefaultCheckout()
            } agent { label 'docker-slave' } stages {
              stage("Sync") {
                steps {
                   script{
                       checkout perforce(credential: 'JenkinsMaster', filter: [incremental(true)], populate: syncOnly(force: false, have: true, modtime: false, parallel: [enable: false, minb
          ytes: '1024', minfiles: '1', threads: '4'], pin: '', quiet: true, revert: false), workspace: templateSpec(charset: 'none', format: 'jenkins-${NODE_NAME}-${JOB_NAME}-src', pinHost:
          false, templateName: "JENKINS-58639-template"))
                }
               }
              }
              stage ("wait_prior_starting_smoke_testing") {
                   steps {
                    echo 'Waiting 20 seconds'
                    sleep 30
                    }
                  }
              stage("Test") {
                steps {
                    sh 'ls'
                }
              }
            }
          }
          {code}
          (4) Create a job with

          !image-2019-09-02-16-25-39-289.png!

          !image-2019-09-02-16-25-59-683.png!

          !image-2019-09-02-16-26-19-383.png!

          !image-2019-09-02-16-26-46-699.png!

          (5) Set quiet period to 5 (not so important).

          (6) Build job once.

          (7) Submit a file to '/ws/JENKINS-58639'.

          (8) Add a trigger to perforce to slow down syncs. For example create script "sleep.sh":
          {code:java}
          echo Sleeping for 600s in trigger...
          sleep 600
          {code}
          make the file executable, then create a trigger entry:
          {code:java}
          trigger.sleep.1 command pre-user-sync ./sleep.sh
          {code}
          (9) Run Poll now. Job will wait 5 seconds then start building.

          (10) Submit another changelist to '/ws/JENKINS-58639'.

          (11) Wait 20 seconds run Poll now. Job will wait 5 seconds then start building.

          (12) Wait 20 seconds run Poll now. Job will wait 5 seconds then start building.

          (13) Wait 20 seconds run Poll now. Job will wait 5 seconds then start building.

          (14) Wait 20 seconds run Poll now. Job will wait 5 seconds then start building.

           

            ]
          Karl Wirth made changes -
          Status Original: Resolved [ 5 ] New: Closed [ 6 ]

            p4karl Karl Wirth
            luckyhorang Hokwang Lee
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: