Skip to content
Permalink
Browse files

[FIXED JENKINS-25164] Add JOB_BASE_NAME env var (#2321)

* [JENKINS-25164] Add SHORT_JOB_NAME env var

* Delete strip off

* [JENKINS-25164] Change SHORT_JOB_NAME for LEAF_JOB_NAME

* [JENKINS-25164] Change LEAF_JOB_NAME for JOB_BASE_NAME
  • Loading branch information...
fbelzunc authored and oleg-nenashev committed May 12, 2016
1 parent 732696b commit 4bab3630efcc2fa331db2989e321d9af1b8cdc1c
@@ -369,6 +369,7 @@ public EnvVars getCharacteristicEnvVars() {
env.put("JENKINS_SERVER_COOKIE",SERVER_COOKIE.get());
env.put("HUDSON_SERVER_COOKIE",SERVER_COOKIE.get()); // Legacy compatibility
env.put("JOB_NAME",getFullName());
env.put("JOB_BASE_NAME", getName());
return env;
}

@@ -3,7 +3,7 @@ package jenkins.model.CoreEnvironmentContributor;
def l = namespace(lib.JenkinsTagLib)

// also advertises those contributed by Run.getCharacteristicEnvVars()
["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 ->
["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"].each { name ->
l.buildEnvVar(name:name) {
raw(_("${name}.blurb"))
}
@@ -1,7 +1,8 @@
BUILD_NUMBER.blurb=The current build number, such as "153"
BUILD_ID.blurb=The current build ID, identical to BUILD_NUMBER for builds created in 1.597+, but a YYYY-MM-DD_hh-mm-ss timestamp for older builds
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". (To strip off folder paths from a Bourne shell script, try: <tt>$'{'JOB_NAME##*/}</tt>)
JOB_NAME.blurb=Name of the project of this build, such as "foo" or "foo/bar".
JOB_BASE_NAME.blurb=Short Name of the project of this build stripping off folder paths, such as "foo" for "bar/foo".
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=\
The unique number that identifies the current executor \

0 comments on commit 4bab363

Please sign in to comment.
You can’t perform that action at this time.