environment variables for 'Execute shell' steps in Jenkins jobs

1,837 views
Skip to first unread message

3lp

unread,
Oct 23, 2012, 5:31:43 AM10/23/12
to jenkins...@googlegroups.com
Hi,

It would be nice to set up environment variables for Jenkins that can be used across all jobs. I am running Jenkins in Tomcat on Linux. It does not seem to be possible to do this within Jenkins or Tomcat configuration. I had thought that adding an <Environment> entry to the context.xml in the Tomcat configuration would do it, but this appears to set some kind of java environment variable. Is there something I am missing here? It would simplify the large number of job files I am setting up if environment variables could be factored out into a (jenkins-) global context.

Thanks

Matthew...@diamond.ac.uk

unread,
Oct 23, 2012, 5:40:24 AM10/23/12
to jenkins...@googlegroups.com

Manage Jenkins à Global properties à Environment variables works for us.

Patrick Byrne

unread,
Oct 23, 2012, 5:42:01 AM10/23/12
to jenkins...@googlegroups.com
<face-palm> Thanks.
--
Patrick Byrne

Grégory Boissinot

unread,
Oct 28, 2012, 11:55:41 AM10/28/12
to jenkins...@googlegroups.com
If you want to add environment variables to the Tomcat process, please refer to the Tomcat documentation (there are several ways to achieve it).
If you want Jenkins to control environment variables, it is natively available in Jenkins. In addition, EnvInject Jenkins plugin is able to set environment variables at Jenkins level for multiple jobs or per job.
Reply all
Reply to author
Forward
0 new messages