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

Commit

Permalink
[JENKINS-28131] - Pass NODE_NAME into node{}
Browse files Browse the repository at this point in the history
  • Loading branch information
recena committed Jun 27, 2015
1 parent b127fd4 commit 535400d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Expand Up @@ -28,7 +28,6 @@ node {
</p>
<ul>
<li><code>EXECUTOR_NUMBER</code></li>
<li><code>NODE_NAME</code></li>
<li><code>NODE_LABELS</code></li>
<li><code>WORKSPACE</code></li>
<li>SCM-specific variables such as <code>SVN_REVISION</code></li>
Expand Down
Expand Up @@ -417,9 +417,12 @@ private final class PlaceholderExecutable implements ContinuableExecutable {
cookie = UUID.randomUUID().toString();
// Switches the label to a self-label, so if the executable is killed and restarted via ExecutorPickle, it will run on the same node:
label = computer.getName();

EnvVars env = computer.getEnvironment();
env.overrideAll(computer.buildEnvironment(listener));
env.put("NODE_NAME", label);
env.put(COOKIE_VAR, cookie);

synchronized (runningTasks) {
runningTasks.put(cookie, new RunningTask(context));
}
Expand Down

0 comments on commit 535400d

Please sign in to comment.