mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-16 21:42:27 +00:00
[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
This commit is contained in:
1 parent
732696bd89
commit
4bab3630ef
3 files changed
+4
-2
No files matched your search
@@ -369,6 +369,7 @@ public abstract class Job<JobT extends Job<JobT, RunT>, RunT extends Run<JobT, R
|
||||
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"))
|
||||
}
|
||||
|
||||
+2
-1
@@ -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 \
|
||||
|
||||
Reference in new issue
Block a user