Support implicit checkout behavior override

This issue is archived. You can view it, but you can't modify it. Learn more

      The implicit checkout behavior is great when you have a single source repo and you're using the standard checkout options. But when you have multiple repos or you want advanced options you have to manually use the checkout() step with your options.

       

      This gets cumbersome when you have multiple stages on multiple agents in parallel.

       

      What would be nice is if I could provide a function to override the implicit checkout behavior, so that anytime an agent is entered my function was called and setup up my source code in the way that I wanted, without having to provide these steps on every single agent step.

       

       

      def myCheckout() {
        dir("prj1") {
           checkout([$class: "GitSCM",
              url: "prj1.git"
           ])
        }
       dir("prj2") {
         checkout([$class: "GitSCM",
             url: "prj2.git"
         ])
       }
      }
      pipeline {
        agent none
        overrideDefaultCheckout myCheckout
      
        stage("Build") {
          agent {    // myCheckout should be called at this point
            label "linux"
          }
          steps {
            sh "cd prj1 && make all"
            sh "cd prj2 && make all"
          }
        }
      }

       

       

            Assignee:
            Unassigned
            Reporter:
            Sean Grider
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Resolved:
              Archived: