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

Global EnvironmentVariableNodeProperty does not show up in Pipeline unless in a node {...} block

      If you have a global environment variable set (let's say SOME_VAR="hi" for this example) in the Jenkins global configuration, that variable will not be in the Pipeline environment until you enter a node block, albeit any node block. So, for example,

      echo "SOME_VAR outside is ${env.SOME_VAR}"
      node {
        echo "SOME_VAR inside is ${env.SOME_VAR}"
      }

      will output

      SOME_VAR outside is null
      SOME_VAR inside is hi

      So I think WorkflowRun needs to include Jenkins.getInstance().getGlobalNodeProperties() when creating its initial environment.

          [JENKINS-43396] Global EnvironmentVariableNodeProperty does not show up in Pipeline unless in a node {...} block

          Andrew Bayer created issue -
          Andrew Bayer made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          Andrew Bayer made changes -
          Status Original: In Progress [ 3 ] New: In Review [ 10005 ]
          Andrew Bayer made changes -
          Remote Link New: This issue links to "PR #43 (Web Link)" [ 15911 ]
          Jesse Glick made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: In Review [ 10005 ] New: Resolved [ 5 ]
          Jesse Glick made changes -
          Link New: This issue is duplicated by JENKINS-40455 [ JENKINS-40455 ]
          Jesse Glick made changes -
          Link New: This issue relates to JENKINS-44334 [ JENKINS-44334 ]

            abayer Andrew Bayer
            abayer Andrew Bayer
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: