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

Github multibranch checkout

    XMLWordPrintable

Details

    Description

      Hi,

      I use github organisation plugin to build jobs inside my github orga.

      Now I ran into following problem:
      It seems that "checkout scm" does nothing for "non-master branches":

      it does not checkout the branch, the directory is stays empty. Only for the master branch it works.

      https://gist.github.com/Flow86/6b6570bc95c24d60fb06baec09103b7d

      the part of my jenkinsfile already failing is this:

      node('master') {
          stage name:"Checkout", concurrency:1
          checkout scm
          sh """set -x
                git submodule foreach "git reset --hard || true" || true
                git reset --hard || true
                git submodule update --init || true
             """
      
          stash includes: '**, .git/', excludes: 'ws/**', name: 'source', useDefaultExcludes: false
      
          sh "env"
      
          wspwd = pwd()
      }
      

      Attachments

        Activity

          flow86 Florian Doersch created issue -
          jglick Jesse Glick made changes -
          Field Original Value New Value
          Component/s github-organization-folder-plugin [ 21427 ]
          jglick Jesse Glick made changes -
          Assignee Kohsuke Kawaguchi [ kohsuke ]
          Resolution Cannot Reproduce [ 5 ]
          Status Open [ 1 ] Resolved [ 5 ]
          flow86 Florian Doersch made changes -
          Resolution Cannot Reproduce [ 5 ]
          Status Resolved [ 5 ] Reopened [ 4 ]
          davidparsson David Pärsson made changes -
          Description Hi,

          I use github organisation plugin to build jobs inside my github orga.

          Now I ran into following problem:
          It seems that "checkout scm" does nothing for "non-master branches":

          it does not checkout the branch, the directory is stays empty. Only for the master branch it works.

          https://gist.github.com/Flow86/6b6570bc95c24d60fb06baec09103b7d

          the part of my jenkinsfile already failing is this:

          {{
          node('master') {
              stage name:"Checkout", concurrency:1
              checkout scm
              sh """set -x
                    git submodule foreach "git reset --hard || true" || true
                    git reset --hard || true
                    git submodule update --init || true
                 """

              stash includes: '**, .git/', excludes: 'ws/**', name: 'source', useDefaultExcludes: false

              sh "env"

              wspwd = pwd()
          }
          }}
          Hi,

          I use github organisation plugin to build jobs inside my github orga.

          Now I ran into following problem:
          It seems that "checkout scm" does nothing for "non-master branches":

          it does not checkout the branch, the directory is stays empty. Only for the master branch it works.

          https://gist.github.com/Flow86/6b6570bc95c24d60fb06baec09103b7d

          the part of my jenkinsfile already failing is this:

          {code}
          node('master') {
              stage name:"Checkout", concurrency:1
              checkout scm
              sh """set -x
                    git submodule foreach "git reset --hard || true" || true
                    git reset --hard || true
                    git submodule update --init || true
                 """

              stash includes: '**, .git/', excludes: 'ws/**', name: 'source', useDefaultExcludes: false

              sh "env"

              wspwd = pwd()
          }
          {code}
          stephenconnolly Stephen Connolly made changes -
          Resolution Cannot Reproduce [ 5 ]
          Status Reopened [ 4 ] Resolved [ 5 ]

          People

            Unassigned Unassigned
            flow86 Florian Doersch
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: