mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-16 21:42:27 +00:00
Fixed BUILD_TAG env var to not say hudson and added JENKINS_* versions of more env vars.
This commit is contained in:
1 parent
c15378ef53
commit
fe103a6c3e
1 file changed
+5
-3
@@ -1766,7 +1766,8 @@ public abstract class Run <JobT extends Job<JobT,RunT>,RunT extends Run<JobT,Run
|
||||
env = c.getEnvironment().overrideAll(env);
|
||||
String rootUrl = Hudson.getInstance().getRootUrl();
|
||||
if(rootUrl!=null) {
|
||||
env.put("HUDSON_URL", rootUrl);
|
||||
env.put("JENKINS_URL", rootUrl);
|
||||
env.put("HUDSON_URL", rootUrl); // Legacy compatibility
|
||||
env.put("BUILD_URL", rootUrl+getUrl());
|
||||
env.put("JOB_URL", rootUrl+getParent().getUrl());
|
||||
}
|
||||
@@ -1796,10 +1797,11 @@ public abstract class Run <JobT extends Job<JobT,RunT>,RunT extends Run<JobT,Run
|
||||
*/
|
||||
public final EnvVars getCharacteristicEnvVars() {
|
||||
EnvVars env = new EnvVars();
|
||||
env.put("HUDSON_SERVER_COOKIE",Util.getDigestOf("ServerID:"+Hudson.getInstance().getSecretKey()));
|
||||
env.put("JENKINS_SERVER_COOKIE",Util.getDigestOf("ServerID:"+Hudson.getInstance().getSecretKey()));
|
||||
env.put("HUDSON_SERVER_COOKIE",Util.getDigestOf("ServerID:"+Hudson.getInstance().getSecretKey())); // Legacy compatibility
|
||||
env.put("BUILD_NUMBER",String.valueOf(number));
|
||||
env.put("BUILD_ID",getId());
|
||||
env.put("BUILD_TAG","hudson-"+getParent().getName()+"-"+number);
|
||||
env.put("BUILD_TAG","jenkins-"+getParent().getName()+"-"+number);
|
||||
env.put("JOB_NAME",getParent().getFullName());
|
||||
return env;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user