-
Bug
-
Resolution: Unresolved
-
Critical
-
None
On Freestyle jobs defining a Jenkins global variable like this would work as expected:
XDG_CACHE_HOME=${HOME}/.cache/${EXECUTOR_NUMBER}
Note: behavior is the same regardless if brackets are used or not when you define the variables.
Freestyle "set" result (correct):
XDG_CACHE_HOME=/home/builder/.cache/2
Pipeline "set" result (incorrect):
XDG_CACHE_HOME=${HOME}/.cache/${EXECUTOR_NUMBER}
This problem is essential because it prevents Jenkins administrators from using environment variables to fix/workaround execution problems.
Effectively this breaks any job that needs to define variables that are relative to something else, like workspace, home, ....
[JENKINS-51260] global environment variables are not expanded (interpolated) in pipelines
Status | Original: Open [ 1 ] | New: In Progress [ 3 ] |
Status | Original: In Progress [ 3 ] | New: In Review [ 10005 ] |
Component/s | New: envinject-plugin [ 15893 ] | |
Component/s | New: workflow-job-plugin [ 21716 ] | |
Component/s | Original: core [ 15593 ] | |
Component/s | Original: pipeline [ 21692 ] |
Do you have EnvInject plugin installed? IIRC Global Env Vars get resolved in such way only if the plugin is installed, but I am not 100% sure.