f-z-N
f-z-N

Reputation: 1827

Environment variables in Jenkins

Where do the environment variables under Jenkins ( manage jenkins -> system information ) come from?

I checked /etc/init.d/tomcat5, /usr/bin/dtomcat5, /usr/bin/tomcat5, /etc/sysconfig/tomcat5 and /etc/profile but do not see any such variables there specially the ones related to Oracle (Base, Home, Ld_lib, path, etc.). Tomcat's bashrc has some oracle related variables which I commented out but I still see the same in the jenkins system info page. Any directions?

Upvotes: 45

Views: 277081

Answers (3)

Farrukh Najmi
Farrukh Najmi

Reputation: 5316

What ultimately worked for me was the following steps:

  1. Configure the Environment Injector Plugin
  2. Goto to the /job/<project>/configure screen
  3. In "Build Environment" section check "Inject environment variables to the build process"
  4. In "Properties Content" specified: TZ=America/New_York

Upvotes: 17

Vikram
Vikram

Reputation: 7525

The quick and dirty way, you can view the available environment variables from the below link.

http://localhost:8080/env-vars.html/

Just replace localhost with your Jenkins hostname, if its different

Upvotes: 21

Alex Bitek
Alex Bitek

Reputation: 6557

The environment variables displayed in Jenkins (Manage Jenkins -> System information) are inherited from the system (i.e. inherited environment variables)

If you run env command in a shell you should see the same environment variables as Jenkins shows.

These variables are either set by the shell/system or by you in ~/.bashrc, ~/.bash_profile.

There are also environment variables set by Jenkins when a job executes, but these are not displayed in the System Information.

Upvotes: 60

Related Questions