Jenkins System Configuration

You apparently would have seen a couple of times in the earlier exercises wherein we had to configure options within Jenkins. The following explains the several configuration options in Jenkins.

So, you can get various configuration options in Jenkins By clicking the Manage Jenkins in Left-hand side panel.

Jenkins Configuration1

You will then be presented with the following screen −

Jenkins Configuration2

Click on Configure system. Discussed below are some of the Jenkins configuration settings which can be carried out.

Jenkins Home Directory

Jenkins needs some disk space to perform builds and keep artifacts. One can check this section from the configuration screen of Jenkins. By default, this is set to ~/.jenkins, and this section will originally be stored within your user profile location. In a conventional environment, you need to change this location to a sufficient place to store all related builds and archives. Once can do this in the following ways

  • Set "JENKINS_HOME" environment variable to the new home directory before launching the servlet container.

  • Set "JENKINS_HOME" system property to the servlet container.

  • Set JNDI environment entry "JENKINS_HOME" to the new directory.

The following example will use the first option of setting the "JENKINS_HOME" environment variable.

First create a new folder E:\Apps\Jenkins. Copy all the contents from the existing ~/.jenkins to this new directory.

Set the JENKINS_HOME environment variable to point to the base directory location where Java is installed on your machine. For example,

OS Output
Windows Set Environmental variable JENKINS_HOME to you’re the location you desire. As an example, you can set it to E:\Apps\Jenkins
Linux export JENKINS_HOME =/usr/local/Jenkins or the location you desire.

In the Jenkins dashboard, click Manage Jenkins from the left-hand side menu. Then click on ‘Configure System’ from the right-hand side.

In the Home directory, you will now see the new directory which has been configured.

Jenkins Home Directory

# of executors

This refers to the total number of concurrent/ parallel jobs executions that can take place on the Jenkins machine/ agent. This can be changed based on requirements or consumptions. Sometimes we recommend is to keep this number the same as the number of CPU on the machines for better performance.

Environment Variables

This is used to add custom environment variables which will apply to all the jobs. These are key-value pairs and can be accessed and used in Builds wherever required.

Jenkins URL

By default, the Jenkins URL points to localhost. If you have a domain name setup for your machine, set this to the domain name else overwrite localhost with IP of the machine. This will help in setting up slaves and while sending out links using the email as you can directly access the Jenkins URL using the environment variable JENKINS_URL which can be accessed as ${JENKINS_URL}.

Email Notification

In the email Notification area, you can configure the SMTP settings for sending out emails. This is required for Jenkins to connect to the SMTP mail server and send out emails to the recipient list.