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

Pipeline: SCM Step : Checkout extensions [Excluded Regions]

XMLWordPrintable

      Hi folks,

      I am seeing an issue with using the Excluded Regions / Included Regions in the Pipeline:SCM step Checkout plugin. My pipeline script clones code from multiple Repos. However, I do not want the job to be triggered for changes in all these Repos. So to suppress builds form changes in one of the Repo, I tried using the extensions. But it seems this feature is not working as expected.

      I have the following code in my pipeline script:

       

      triggers { pollSCM('H/5 * * * *') }

      dir ('script') {dir ('script') {
             checkout([
                 $class           : 'GitSCM',

                  branches         : [[name: '*/master']], 

                  extensions       : [

                                  [$class: 'PathRestriction', excludedRegions: ''], 

                                  [$class: 'CleanBeforeCheckout'],                          

                                  [$class: 'DisableRemotePoll']   

                 ],

                  userRemoteConfigs: [[       

                             credentialsId: '12345-xxxxx',
                             name         : 'origin',

                             refspec      : '+refs/heads/:refs/remotes/origin/+refs/pull/*:refs/remotes/origin/pr/    *',

                              url          : 'https://wwwin-github.company.com/myrepo/mycode'

                 ]]  

                  ])

         }

       

      With the above code, I am under impression that the all changes will be excluded as I kep "excludedRegions" as empty. I have also added '$class:DisableRemotePoll' to see if that works.  None of the above could prevent the build for any changes in the repo.

      Could someone pls guide me on how to suppress triggering builds for any repo that I clone in my pipeline script? 

       

      Thanks

      -hyvrt

       

       

            Unassigned Unassigned
            hyvrt aiun rluk
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: