NOTE: This changed in Jenkins 1.597, Please see here for more info regarding the migration
You should be able to view all the global environment variables that are available during the build by navigating to https://<your-jenkins>/env-vars.html
.
Replace https://<your-jenkins>/
with the URL you use to get to Jenkins webpage (for example, it could be http://localhost:8080/env-vars.html
).
One of the environment variables is :
BUILD_ID
The current build id, such as "2005-08-22_23-59-59" (YYYY-MM-DD_hh-mm-ss)
If you use jenkins editable email notification, you should be able to use ${ENV, var="BUILD_ID"}
in the subject line of your email.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…