-
Bug
-
Resolution: Unresolved
-
Minor
If you try something like
agent { label "${SOME_ENV_VAR}" } environment { SOME_ENV_VAR = "some-label" }
You'll get an error due to SOME_ENV_VAR not existing in the binding. Not ideal, obviously, but I'm not sure if we can actually solve this without significant rewrites.
- is duplicated by
-
JENKINS-46525 NPE: Cannot invoke method getScript() on null object in stage/agent/label
-
- Closed
-
-
JENKINS-44352 Variable resolution in GString fails for docker args
-
- Closed
-
- links to
Core problem here is that we evaluate the environment after we enter the agent - there are plenty of valid use cases for using env vars that don't exist until we enter the agent (like WORKSPACE, e.g.) in the environment block, but less for using environment variables in the agent, IMO. So this probably won't happen.