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

EnvInject doesn't see GIT_COMMIT even after SCM phase

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • envinject-plugin
    • None
    • Jenkins 1.596.2
      Environment Injector Plugin 1.92
      GIT plugin 2.4.0

      Variables provided by Git plugin (tested with GIT_COMMIT) are not accessible in EnvInject plugin even if applied after SCM phase (Build Environment -> Inject environment variables to the build process).

      Sample Groovy code used in "Evaluated Groovy script":

      [GIT_COMMIT_SHORT: GIT_COMMIT]
      

      ends with: "[EnvInject] - [ERROR] - Problems occurs on injecting env vars as a build wrap: null". It works wine with JOB_NAME or similar. GIT_COMMIT variable is later accessible in a build step.

      Sample Use case: Get a short version of Git commit SHA fetch by a job.

          [JENKINS-30042] EnvInject doesn't see GIT_COMMIT even after SCM phase

          Marcin Zajączkowski created issue -
          Manuel Recena Soto made changes -
          Assignee Original: Manuel Recena Soto [ recena ] New: Oleg Nenashev [ oleg_nenashev ]
          R. Tyler Croy made changes -
          Workflow Original: JNJira [ 165123 ] New: JNJira + In-Review [ 181843 ]
          Oleg Nenashev made changes -
          Assignee Original: Oleg Nenashev [ oleg_nenashev ]

            Unassigned Unassigned
            emszpak Marcin Zajączkowski
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated: