-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
Centos 7, Jenkins 2.60.2, Environment Injector Plugin 2.1.3, Pipeline 2.5
The env injector plugin is available on a Pipeline job. If one attempts to override an env var defined in Jenkins Config, the new value is not made available to the DSL for the pipeline.
In Jenkins config set env var FOO=BAR
In Pipeline job env injector check "Prepare an environment for the run" and then in "Properties Content" add "FOO=BAZ"
For pipeline script
node() {
stage('vars') {
sh 'env'
}
}
Run the job and console output will show env var FOO=BAR
One is able to override env var using Freestyle project.
If env injector plugin is NOT the proper way to override global env vars, please advise on what is the correct way to accomplish this in a pipeline.