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

Overrides to global env vars not honored on pipeline job

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Component/s: envinject-plugin, pipeline
    • Labels:
      None
    • Environment:
      Centos 7, Jenkins 2.60.2, Environment Injector Plugin 2.1.3, Pipeline 2.5
    • Similar Issues:

      Description

      The env injector plugin is available on a Pipeline job. If one attempts to override an env var defined in Jenkins Config, the new value is not made available to the DSL for the pipeline.

      In Jenkins config set env var FOO=BAR

      In Pipeline job env injector check "Prepare an environment for the run" and then in "Properties Content" add "FOO=BAZ"

       

      For pipeline script

       

      node() {
         stage('vars') {
             sh 'env'
        }
      }

       

      Run the job and console output will show env var FOO=BAR

       

      One is able to override env var using Freestyle project.

       

      If env injector plugin is NOT the proper way to override global env vars, please advise on what is the correct way to accomplish this in a pipeline.

       

        Attachments

          Activity

          Hide
          oleg_nenashev Oleg Nenashev added a comment -

          As it documented in the plugin Wiki, the plugin does not fully support Pipeline. Maybe it's something related to JENKINS-26583

          Show
          oleg_nenashev Oleg Nenashev added a comment - As it documented in the plugin Wiki, the plugin does not fully support Pipeline. Maybe it's something related to JENKINS-26583
          Hide
          pjdarton pjdarton added a comment -

          This sounds very much like JENKINS-14437, which affects non-pipeline usage.

          Show
          pjdarton pjdarton added a comment - This sounds very much like JENKINS-14437 , which affects non-pipeline usage.

            People

            • Assignee:
              Unassigned
              Reporter:
              peternhale Pete Hale
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: