How to set environment variables in Jenkins?
Here is the step by step guide to set environment variable in jenkins. It involves various steps discussed in detailed as follow:
Step 1: Login to your Jenkins Dashboard
The first step is to login to your Jenkin dashboard by your User id and password
Step 2: Navigate to Manage Jenkins
In the Jenkins dashboard look for the Manage Jenkins option on the left side of the panel and click on it.
Now, after that select the first option Configure System to configure global settings and path configuration.
After this you will redirected to configuration page, Just Scroll down to set Environment Variable in Jenkins.
Step 3: Configure Environment Variable:
When you will Scroll down you will see Global Properties section under which you have enable environment variable option by selecting the Checkbox.
Step 4: Add Name and Value
Now, Pass the Name and Value (Path) accordingly as per the requirement and also it must be noted that you can add multiple environment variable, then click on apply button to save changes.
Step 5: Test Environment Variable
This is one of the most important steps to test whether the environment variable is configured properly or not. We can test it out by just choose configure option.
Now we are going to run a command, then click apply to save changes
echo $Variable Name
Now choose Build now from left side of the panel
Step 6: Console Output
You can see that we have successfully tested and set environment variable in jenkins.
How To Set Environment Variables In Jenkins ?
Jenkins is a widely used open-source automation server that facilitates continuous integration and continuous delivery (CI/CD) processes. One powerful feature of Jenkins is its capability to configure environment variables, which are important for various functions like defining parameters, paths, and settings required by numerous jobs and build processes. In this article, we are going to discuss how we can set environment variables in Jenkins to enhance the efficiency of your automation workflows.
Contact Us