Creating Environment Variables

There are different ways to specify environment variables in Jenkins. To specify an environment variable that applies globally, go to the Jenkins configuration pages. You can also specify environment variables that only apply to individual nodes, or ones that are set as an external step before starting Jenkins.

In a scenario where you have Visual COBOL installed on multiple platforms on agent machines, using environment variables for common installation paths can greatly simplify the creation of new projects.

For example, you can have an environment variable for the Visual COBOL installation directory on Windows, and another one for the corresponding location on UNIX. Other environment variables could point to locations such as the installation location of Eclipse, the default source code control system check-out folder, the workspace directory, or the location of the samples.

To set global environment variables in Jenkins:

  1. From the Jenkins Home page, click Manage Jenkins.
  2. Click Configure System.
  3. In the Global properties section, check Environment variables.
  4. Click Add and set any environment variables for paths that might be the same across a number of slave machines.

To set environment variables for a node:

  1. In the configuration page of the node, check Environment variables in the Node Properties section.
  2. Click Add and specify any environment variables as required.