3

I notice that with our Jenkins 1.625.2, setting a Environment Variable for all nodes via jenkins/configure -> Global properties -> Environment variables only work, iff the environment variable in question is not already defined in the Windows system environment of a node.

That is, if the Windows user that runs the Jenkins Slave process already has the environment variable FOOBAR, the setting FOOBAR in the global Jenkins Config has no effect on this node, whereas if the envvar is not there, then jobs run on the node will get it set to the global Jenkins config value.

Does anyone know if this is intended behavior, a bug, or whether I may be missing something to get the global setting override the system envvar on the Windows node?

Martin Ba
  • 37,187
  • 33
  • 183
  • 337

1 Answers1

0

You can override the already defined environment variables with global variables from Jenkins by selecting the Prepare an environment for run checkbox and selecting the Override Build Parameters option underneath:

Jenkins override environment

Revive
  • 2,248
  • 1
  • 16
  • 23
  • I'll note that the Jobs in question do not use the EnvInject plugin at all. But I have EnvInject installed, so maybe there's a catch here. – Martin Ba Dec 21 '16 at 11:28
  • 1
    Seems possible: http://stackoverflow.com/questions/23502306/modify-path-variable-in-jenkins-master – Revive Dec 21 '16 at 11:38