-
New Feature
-
Resolution: Fixed
-
Minor
-
None
With the Pipeline Plugin, I'd like a list of environment variables to be returned from the build result of a job (like you can already do with `duration` and `description`)
For example,
def e = build "test-env" echo "${e.environment.GIT_COMMIT}" echo "${e.environment.FOO}"
I believe the fix is to add a whitelisted getEnvironment() method to the RunWrapper, similar to the one done in this merged PR here for JENKINS-36306
The current fix is to access the environment variables is to access it via the rawBuild, however that needs to be explicitly whitelisted as RunWrapper.getRawBuild is blacklisted
def e = build "test-env" echo "${e.rawBuild.environment.GIT_COMMIT}"
Thanks
- is duplicated by
-
JENKINS-36213 build-step - obtain environment variables from a non-pipeline job
- Resolved
- links to