提交 7578aa93 编写于 作者: K Kohsuke Kawaguchi

expose the display name of the build as environment variable

上级 070f74f6
......@@ -29,6 +29,8 @@ public class CoreEnvironmentContributor extends EnvironmentContributor {
env.putAll(compEnv);
}
env.put("BUILD_DISPLAY_NAME",r.getDisplayName());
Jenkins j = Jenkins.getInstance();
String rootUrl = j.getRootUrl();
if(rootUrl!=null) {
......
......@@ -3,7 +3,7 @@ package jenkins.model.CoreEnvironmentContributor;
def l = namespace(lib.JenkinsTagLib)
// also advertises those contributed by Run.getCharacteristicEnvVars()
["BUILD_NUMBER","BUILD_ID","JOB_NAME","BUILD_TAG","EXECUTOR_NUMBER","NODE_NAME","NODE_LABELS","WORKSPACE","JENKINS_HOME","JENKINS_URL","BUILD_URL","JOB_URL"].each { name ->
["BUILD_NUMBER","BUILD_ID","BUILD_DISPLAY_NAME","JOB_NAME","BUILD_TAG","EXECUTOR_NUMBER","NODE_NAME","NODE_LABELS","WORKSPACE","JENKINS_HOME","JENKINS_URL","BUILD_URL","JOB_URL"].each { name ->
l.buildEnvVar(name:name) {
raw(_("${name}.blurb"))
}
......
BUILD_NUMBER.blurb=The current build number, such as "153"
BUILD_ID.blurb=The current build id, such as "2005-08-22_23-59-59" (YYYY-MM-DD_hh-mm-ss)
BUILD_DISPLAY_NAME.blurb=The display name of the current build, which is something like "#153" by default.
JOB_NAME.blurb=Name of the project of this build, such as "foo" or "foo/bar"
BUILD_TAG.blurb=String of "jenkins-<i>$'{'JOB_NAME}</i>-<i>$'{'BUILD_NUMBER}</i>". Convenient to put into a resource file, a jar file, etc for easier identification.
EXECUTOR_NUMBER.blurb=\
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册