use of hudson.slaves.NodeSpecific in project hudson-2.x by hudson.
the class InstallToolCommand method install.
/**
* Performs an installation.
*/
private int install(ToolInstallation t, BuildIDs id, AbstractProject p) throws IOException, InterruptedException {
Run b = p.getBuildByNumber(Integer.parseInt(id.number));
if (b == null)
throw new AbortException("No such build: " + id.number);
Executor exec = b.getExecutor();
if (exec == null)
throw new AbortException(b.getFullDisplayName() + " is not building");
Node node = exec.getOwner().getNode();
if (t instanceof NodeSpecific) {
NodeSpecific n = (NodeSpecific) t;
t = (ToolInstallation) n.forNode(node, new StreamTaskListener(stderr));
}
if (t instanceof EnvironmentSpecific) {
EnvironmentSpecific e = (EnvironmentSpecific) t;
t = (ToolInstallation) e.forEnvironment(EnvVars.getRemote(channel));
}
stdout.println(t.getHome());
return 0;
}
Aggregations