Jenkins Pipeline Environment Variables: Difference between revisions
Jump to navigation
Jump to search
(Created page with "=Internal= * Jenkins Concepts =Overview= Jenkins Pipeline exposes environment variables via the global variable <code>env...") |
|||
Line 5: | Line 5: | ||
Jenkins Pipeline exposes environment variables via the global variable <code>env</code>, which is available from anywhere in the [[Jenkins_Concepts#Jenkinsfile|Jenkinsfile]]. | Jenkins Pipeline exposes environment variables via the global variable <code>env</code>, which is available from anywhere in the [[Jenkins_Concepts#Jenkinsfile|Jenkinsfile]]. | ||
The full environment variables accessible from within Jenkins Pipeline is documented at http://<jenkins-instance-url>/pipeline-syntax/globals#env. | |||
=Environment Variables= | |||
==BUILD_ID== | |||
The current build ID, identical to [[#BUILD_NUMBER|BUILD_NUMBER]]. | |||
==BUILD_NUMBER== | |||
The current build number, such as "153". Same as [[#BUILD_ID|BUILD_ID]]. | |||
==BUILD_TAG== | |||
It is an environment variable that contains job name, branch name, build number. | |||
==JOB_NAME== | |||
==JOB_BASE_NAME== |
Revision as of 22:31, 17 April 2020
Internal
Overview
Jenkins Pipeline exposes environment variables via the global variable env
, which is available from anywhere in the Jenkinsfile.
The full environment variables accessible from within Jenkins Pipeline is documented at http://<jenkins-instance-url>/pipeline-syntax/globals#env.
Environment Variables
BUILD_ID
The current build ID, identical to BUILD_NUMBER.
BUILD_NUMBER
The current build number, such as "153". Same as BUILD_ID.
BUILD_TAG
It is an environment variable that contains job name, branch name, build number.