-
Bug
-
Resolution: Fixed
-
Major
-
None
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.
- is duplicated by
-
JENKINS-40455 Global environment variables are not accessible outside of node { }
-
- Resolved
-
- relates to
-
JENKINS-44334 Pipeline: Job v2.11 breaks build with bat() command
-
- Open
-
- links to
PR up for this at https://github.com/jenkinsci/workflow-job-plugin/pull/43