Skip to content
This repository was archived by the owner on Dec 15, 2021. It is now read-only.

Commit ae1b4c9

Browse files
author
recena
committedJun 27, 2015
[JENKINS-28131] - Pass NODE_NAME into node{}
1 parent b127fd4 commit ae1b4c9

File tree

2 files changed

+3
-1
lines changed
  • cps/src/main/resources/org/jenkinsci/plugins/workflow/cps/EnvActionImpl/Binder
  • support/src/main/java/org/jenkinsci/plugins/workflow/support/steps

2 files changed

+3
-1
lines changed
 

‎cps/src/main/resources/org/jenkinsci/plugins/workflow/cps/EnvActionImpl/Binder/help.jelly

-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ node {
2828
</p>
2929
<ul>
3030
<li><code>EXECUTOR_NUMBER</code></li>
31-
<li><code>NODE_NAME</code></li>
3231
<li><code>NODE_LABELS</code></li>
3332
<li><code>WORKSPACE</code></li>
3433
<li>SCM-specific variables such as <code>SVN_REVISION</code></li>

‎support/src/main/java/org/jenkinsci/plugins/workflow/support/steps/ExecutorStepExecution.java

+3
Original file line numberDiff line numberDiff line change
@@ -417,9 +417,12 @@ private final class PlaceholderExecutable implements ContinuableExecutable {
417417
cookie = UUID.randomUUID().toString();
418418
// Switches the label to a self-label, so if the executable is killed and restarted via ExecutorPickle, it will run on the same node:
419419
label = computer.getName();
420+
420421
EnvVars env = computer.getEnvironment();
421422
env.overrideAll(computer.buildEnvironment(listener));
423+
env.put("NODE_NAME", label);
422424
env.put(COOKIE_VAR, cookie);
425+
423426
synchronized (runningTasks) {
424427
runningTasks.put(cookie, new RunningTask(context));
425428
}

0 commit comments

Comments
 (0)