private static void fireOnRollback(final NodeProvisioner.PlannedNode plannedNode, final Node newNode, final Throwable cause) { for (CloudProvisioningListener cl : CloudProvisioningListener.all()) { try { cl.onRollback(plannedNode, newNode, cause); } catch (Error e) { throw e; } catch (Throwable e) { LOGGER.log(Level.SEVERE, "Unexpected uncaught exception encountered while " + "processing onRollback() listener call in " + cl + " for agent " + newNode.getDisplayName(), e); } } }
private static void fireOnCommit(final NodeProvisioner.PlannedNode plannedNode, final Node newNode) { for (CloudProvisioningListener cl : CloudProvisioningListener.all()) { try { cl.onCommit(plannedNode, newNode); } catch (Error e) { throw e; } catch (Throwable e) { LOGGER.log(Level.SEVERE, "Unexpected uncaught exception encountered while " + "processing onCommit() listener call in " + cl + " for agent " + newNode.getDisplayName(), e); } } }
@Override public String getShortDescription() { Computer computer = node.toComputer(); String name = computer != null ? computer.getDisplayName() : node.getDisplayName(); return Messages.Node_BecauseNodeIsNotAcceptingTasks(name); }
public static String encodeTo(Node node) { Computer c = node.toComputer(); if (c != null) { return encodeTo("/" + c.getUrl(), node.getDisplayName()); } String nodePath = node == Jenkins.getInstance() ? "(master)" : node.getNodeName(); return encodeTo("/computer/" + nodePath, node.getDisplayName()); }
public FilePath performInstallation(ToolInstallation tool, Node node, TaskListener log) throws IOException, InterruptedException { FilePath dir = preferredLocation(tool, node); if (dir.installIfNecessaryFrom(new URL(url), log, "Unpacking " + url + " to " + dir + " on " + node.getDisplayName())) { dir.act(new ChmodRecAPlusX()); } if (subdir == null) { return dir; } else { return dir.child(subdir); } }
public String getShortDescription() { String name = (node.toComputer() != null) ? node.toComputer().getDisplayName() : node.getDisplayName(); return Messages.Queue_NodeOffline(name); }
public String getShortDescription() { String name = (node.toComputer() != null) ? node.toComputer().getDisplayName() : node.getDisplayName(); return Messages.Queue_WaitingForNextAvailableExecutorOn(name); }
public String getToolHome(Node node, ToolInstallation tool, TaskListener log) throws IOException, InterruptedException { if (node.getRootPath() == null) { log.error(node.getDisplayName() + " is offline; cannot locate " + tool.getName()); return null; installer.getDescriptor().getDisplayName(), tool.getName(), node.getDisplayName()));
check = shouldBeDeleted(item, ws, node); } catch (IOException x) { Functions.printStackTrace(x, listener.error("Failed to check " + node.getDisplayName())); continue; } catch (InterruptedException x) { Functions.printStackTrace(x, listener.error("Failed to check " + node.getDisplayName())); continue; listener.getLogger().println("Deleting " + ws + " on " + node.getDisplayName()); try { ws.deleteRecursive(); WorkspaceList.tempDir(ws).deleteRecursive(); } catch (IOException x) { Functions.printStackTrace(x, listener.error("Failed to delete " + ws + " on " + node.getDisplayName())); } catch (InterruptedException x) { Functions.printStackTrace(x, listener.error("Failed to delete " + ws + " on " + node.getDisplayName()));
/** * Convenience method to find a location to install a tool. * @param tool the tool being installed * @param node the computer on which to install the tool * @return {@link ToolInstallation#getHome} if specified, else a path within the local * Jenkins work area named according to {@link ToolInstallation#getName} * @since 1.310 */ protected final FilePath preferredLocation(ToolInstallation tool, Node node) { if (node == null) { throw new IllegalArgumentException("must pass non-null node"); } String home = Util.fixEmptyAndTrim(tool.getHome()); if (home == null) { home = sanitize(tool.getDescriptor().getId()) + File.separatorChar + sanitize(tool.getName()); } FilePath root = node.getRootPath(); if (root == null) { throw new IllegalArgumentException("Node " + node.getDisplayName() + " seems to be offline"); } return root.child("tools").child(home); }
/** * Adds a node * * @since 1.513 */ public ContextMenu add(Node n) { Computer c = n.toComputer(); return add(new MenuItem() .withDisplayName(n.getDisplayName()) .withStockIcon((c==null) ? "computer.png" : c.getIcon()) .withContextRelativeUrl(n.getSearchUrl())); }
public FilePath performInstallation(ToolInstallation tool, Node node, TaskListener log) throws IOException, InterruptedException { FilePath expected = preferredLocation(tool, node); Installable inst = getInstallable(); if(inst==null) { log.getLogger().println("Invalid tool ID "+id); return expected; } if (inst instanceof NodeSpecific) { inst = (Installable) ((NodeSpecific) inst).forNode(node, log); } if(isUpToDate(expected,inst)) return expected; if(expected.installIfNecessaryFrom(new URL(inst.url), log, "Unpacking " + inst.url + " to " + expected + " on " + node.getDisplayName())) { expected.child(".timestamp").delete(); // we don't use the timestamp FilePath base = findPullUpDirectory(expected); if(base!=null && base!=expected) base.moveAllChildrenTo(expected); // leave a record for the next up-to-date check expected.child(".installedFrom").write(inst.url,"UTF-8"); expected.act(new ZipExtractionInstaller.ChmodRecAPlusX()); } return expected; }
Label l = item.getAssignedLabel(); if(l!=null && !l.contains(this)) return CauseOfBlockage.fromMessage(Messages._Node_LabelMissing(getDisplayName(), l)); // the task needs to be executed on label that this node doesn't have. || Jenkins.getInstance().getMode() == Mode.EXCLUSIVE) )) { return CauseOfBlockage.fromMessage(Messages._Node_BecauseNodeIsReserved(getDisplayName())); // this node is reserved for tasks that are tied to it if (!(SKIP_BUILD_CHECK_ON_FLYWEIGHTS && item.task instanceof Queue.FlyweightTask) && !hasPermission(identity, Computer.BUILD)) { return CauseOfBlockage.fromMessage(Messages._Node_LackingBuildPermission(identity.getName(), getDisplayName()));
@Override protected void calculate(Run<?,?> build, JSONObject element) { BallColor iconColor = build.getIconColor(); element.put("iconColorOrdinal", iconColor.ordinal()); element.put("iconColorDescription", iconColor.getDescription()); element.put("buildStatusUrl", build.getBuildStatusUrl()); element.put("number", build.getNumber()); element.put("displayName", build.getDisplayName()); element.put("duration", build.getDuration()); element.put("durationString", build.getDurationString()); if (build instanceof AbstractBuild) { AbstractBuild<?,?> b = (AbstractBuild) build; Node n = b.getBuiltOn(); if (n == null) { String ns = b.getBuiltOnStr(); if (ns != null && !ns.isEmpty()) { element.put("builtOnStr", ns); } } else if (n != Jenkins.getInstance()) { element.put("builtOn", n.getNodeName()); element.put("builtOnStr", n.getDisplayName()); } else { element.put("builtOnStr", hudson.model.Messages.Hudson_Computer_DisplayName()); } } }
@Override public String getShortDescription() { return Messages.Queue_NodeOffline(node.getDisplayName()); } }
public static String encodeTo(Node node) { Computer c = node.toComputer(); if (c != null) { return encodeTo("/" + c.getUrl(), node.getDisplayName()); } String nodePath = node == Jenkins.getInstance() ? "(master)" : node.getNodeName(); return encodeTo("/computer/" + nodePath, node.getDisplayName()); }
@Override public String getShortDescription() { Computer computer = node.toComputer(); String name = computer != null ? computer.getDisplayName() : node.getDisplayName(); return Messages.Node_BecauseNodeIsNotAcceptingTasks(name); }
@Override public String getDisplayName() { initPython(); if (pexec.isImplemented(0)) { return (String) pexec.execPython("get_display_name"); } else { return super.getDisplayName(); } }
public FilePath performInstallation(ToolInstallation tool, Node node, TaskListener log) throws IOException, InterruptedException { FilePath dir = preferredLocation(tool, node); if (dir.installIfNecessaryFrom(new URL(url), log, "Unpacking " + url + " to " + dir + " on " + node.getDisplayName())) { dir.act(new ChmodRecAPlusX()); } if (subdir == null) { return dir; } else { return dir.child(subdir); } }
/** * Adds a node * * @since 1.513 */ public ContextMenu add(Node n) { Computer c = n.toComputer(); return add(new MenuItem() .withDisplayName(n.getDisplayName()) .withStockIcon((c==null) ? "computer.png" : c.getIcon()) .withContextRelativeUrl(n.getSearchUrl())); }