Two ways to use
1. Use the $ flag directly: such as $BUILD_STATUS
2. Use the ${} flag: such as ${BUILD_STATUS}
Remark:
If the batch command is used to use environment variables, it is marked by %%, such as % BUILD_STATUS %
List of environment variables:
BUILD_NUMBER, uniquely identifies a build, such as 23;
BUILD_ID, basically equivalent to BUILD_NUMBER, but a string, such as 2011-11-15_16-06-21;
JOB_NAME, the name of the job, such as JavaHelloWorld;
BUILD_TAG, the same as BUILD_ID, BUILD_NUMBER, is used to uniquely identify a build globally, such as jenkins-JavaHelloWorld-23;
EXECUTOR_NUMBER, eg 0;
NODE_NAME, the name of the slave, such as MyServer01;
NODE_LABELS, the label of the slave, identifies the use of the slave, such as JavaHelloWorldMyServer01;
JAVA_HOME, the home directory of Java , such as C:\Program Files (x86)\Java\jdk1.7.0_01;
WORKSPACE, the current working directory of the job, such as c:\jenkins\workspace\JavaHelloWorld;
HUDSON_URL = JENKINS_URL, jenkins的url,例如http://localhost:8000/;
BUILD_URL,build的url 例如http://localhost:8000/job/JavaHelloWorld/23/;
JOB_URL, the url of the job, such as http://localhost:8000/job/JavaHelloWorld/;
SVN_REVISION, revison of svn, for example 4;
http://blog.csdn.net/hwhua1986/article/details/47749853