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

No GIT_* environment entries set during pipeline run

XMLWordPrintable

    • 1.1.0

      Environment entries like GIT_COMMIT, GIT_BRANCH, etc. are null when using this integration.

      pipeline {
      agent any

      stages {
      stage('stage') {
      steps {
      echo "Value is: ${env.GIT_COMMIT}"
      }
      }
      }
      }

      will output Value is: null

      com.atlassian.bitbucket.jenkins.internal.scm.BitbucketSCM delegates a lot of calls to hudson.plugins.git.GitSCM, however method buildEnvironment(Run<?, ?> build, Map<String, String> env) is omitted and not overridden and the default implementation takes place causing all environment entries generated by Git plugin to be missing.

            mhenschke_atlassian Martin Henschke
            tomis Martin Tee
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: