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

Mixed checkout info in console output when two git statements in pipeline

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • RHEL 7, OpenJDK 1.8.0_191, Jenkins LTS 2.150.3
      Git plugin 3.9.3, Git client plugin 2.7.6, SCM API plugin 2.3.0, Pipeline: SCM Step 2.7

      When I have two git repos checkout in a pipeline, the console output is inconsistent and the info is mixed up. All the repo info i s specified in the Jenkinsfile.

      def REPO1_URL = 'ssh://git@bitbucket.acme.org:7999/~XXXXX/repo1.git'
      def REPO1_BRANCH = 'master'
      def REPO2_URL = 'ssh://git@bitbucket.acme.org:7999/~XXXXX/repo2.git'
      def REPO2_BRANCH = 'branch'
          
      node('git && linux') {
          dir('git-repo1') {
              deleteDir()
              git(url: "${REPO1_URL}", branch: "${REPO1_BRANCH}", credentialsId: 'bitbucket-creds')
          }
          dir('git-repo2') {
              deleteDir()
              git(url: "${REPO2_URL}", branch: "${REPO2_BRANCH}", credentialsId: 'bitbucket-creds')
          }
      }
      

      Console output:

      Started by user XXXXXXX
      Running in Durability level: MAX_SURVIVABILITY
      [Pipeline] Start of Pipeline

      [Pipeline] node

      Running on XXX in /var/lib/jenkins/workspace/XXXXX/XXXXX-two-git-stmt-bug
      [Pipeline] {

      [Pipeline] dir

      Running in /var/lib/jenkins/workspace/XXXXX/XXXXX-two-git-stmt-bug/git-repo1
      [Pipeline]

      Unknown macro: { [Pipeline] deleteDir [Pipeline] git using credential bitbucket-credsCloning the remote Git repositoryChecking out Revision 46ad07ce6d689dda4f59e1aff54fc45b8dc1786a (refs/remotes/origin/master)Commit message}

      [Pipeline] // dir
      [Pipeline] dir

      Running in /var/lib/jenkins/workspace/XXXXX/XXXXX-two-git-stmt-bug/git-repo2
      [Pipeline] {

      [Pipeline] deleteDir

      [Pipeline] git

      using credential bitbucket-creds
      Cloning the remote Git repository
      Cloning repository ssh://git@bitbucket.acme.org:7999/~XXXXX/repo1.git
      > git init /var/lib/jenkins/workspace/XXXXX/XXXXX-two-git-stmt-bug/git-repo1 # timeout=10
      Fetching upstream changes from ssh://git@bitbucket.acme.org:7999/~XXXXX/repo1.git
      > git --version # timeout=10
      using GIT_SSH to set credentials SSH key credentials for Jenkins to access Bitbucket
      > git fetch --tags --progress ssh://git@bitbucket.acme.org:7999/~XXXXX/repo1.git +refs/heads/:refs/remotes/origin/
      > git config remote.origin.url ssh://git@bitbucket.acme.org:7999/~XXXXX/repo1.git # timeout=10
      > git config --add remote.origin.fetch +refs/heads/:refs/remotes/origin/ # timeout=10
      > git config remote.origin.url ssh://git@bitbucket.acme.org:7999/~XXXXX/repo1.git # timeout=10
      Fetching upstream changes from ssh://git@bitbucket.acme.org:7999/~XXXXX/repo1.git
      using GIT_SSH to set credentials SSH key credentials for Jenkins to access Bitbucket
      > git fetch --tags --progress ssh://git@bitbucket.acme.org:7999/~XXXXX/repo1.git +refs/heads/:refs/remotes/origin/
      > git rev-parse refs/remotes/origin/master^

      Unknown macro: {commit}
      1. timeout=10
        > git rev-parse refs/remotes/origin/origin/master^

      # timeout=10
      > git config core.sparsecheckout # timeout=10
      > git checkout -f 46ad07ce6d689dda4f59e1aff54fc45b8dc1786a
      > git branch -a -v --no-abbrev # timeout=10
      > git checkout -b master 46ad07ce6d689dda4f59e1aff54fc45b8dc1786a
      > git rev-list --no-walk 46ad07ce6d689dda4f59e1aff54fc45b8dc1786a # timeout=10
      Checking out Revision 417fb7a4802dc7d6deac4a54f7743dd9e0e92103 (refs/remotes/origin/branch)
      Commit message: "xxx"
      [Pipeline] }
      [Pipeline] // dir
      [Pipeline] }
      [Pipeline] // node
      [Pipeline] End of Pipeline
      Finished: SUCCESS

      Note that for the second checkout htere is way more logging. Also, most of the info in the second checkout logging is related to repo1 which is for the first checkout.

      However, the actual code checkout seems to be right.

            Unassigned Unassigned
            ahammar Anders Hammar
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: