Manipulating environmental variables

This recipe shows you how to pass variables from Jenkins to your build Job and how different variables are overwritten. It also describes one way of failing the build if crucial information has not been correctly passed.

Jenkins has a number of plugins for passing information to builds including the Setenv plugin (, Envfile plugin (, and the EnvInject plugin ( The Envinject plugin was chosen for this recipe as it is reported to work with nodes and offers a wide range of property injection options.

Getting ready

Install the Envinject ...

Get Jenkins Continuous Integration Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.