-
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
[JENKINS-43396] Global EnvironmentVariableNodeProperty does not show up in Pipeline unless in a node {...} block
Status | Original: Open [ 1 ] | New: In Progress [ 3 ] |
Status | Original: In Progress [ 3 ] | New: In Review [ 10005 ] |
Remote Link | New: This issue links to "PR #43 (Web Link)" [ 15911 ] |
Resolution | New: Fixed [ 1 ] | |
Status | Original: In Review [ 10005 ] | New: Resolved [ 5 ] |
Link |
New:
This issue is duplicated by |
PR up for this at https://github.com/jenkinsci/workflow-job-plugin/pull/43