Jenkins environment variables
Jenkins have some built-in environment variables which are available to use in scripts. All the variables are self explanatory with their name itself and are listed below.
BUILD_NUMBER
BUILD_ID
BUILD_DISPLAY_NAME
JOB_NAME
JOB_BASE_NAME
BUILD_TAG
EXECUTOR_NUMBER
NODE_NAME
NODE_LABELS
WORKSPACE
JENKINS_HOME
JENKINS_URL
BUILD_URL
JOB_URL
These variables can be used in Jenkins scripts without any prior initialization.