Search in sources :

Example 1 with FilePathContent

use of com.cloudbees.jenkins.support.api.FilePathContent in project support-core-plugin by jenkinsci.

the class ProcFilesRetriever method addUnixContents.

protected void addUnixContents(@NonNull Container container, @NonNull final Node node) {
    Computer c = node.toComputer();
    if (c == null || c.isOffline()) {
        return;
    }
    // fast path bailout for Windows
    if (!Boolean.TRUE.equals(c.isUnix())) {
        return;
    }
    SystemPlatform nodeSystemPlatform = getSystemPlatform(node);
    if (!SystemPlatform.LINUX.equals(nodeSystemPlatform)) {
        return;
    }
    String name;
    if (node instanceof Jenkins) {
        name = "master";
    } else {
        name = "slave/" + node.getNodeName();
    }
    for (Map.Entry<String, String> procDescriptor : getFilesToRetrieve().entrySet()) {
        container.add(new FilePathContent("nodes/" + name + "/proc/" + procDescriptor.getValue(), new FilePath(c.getChannel(), procDescriptor.getKey())));
    }
    afterAddUnixContents(container, node, name);
}
Also used : Jenkins(jenkins.model.Jenkins) FilePath(hudson.FilePath) FilePathContent(com.cloudbees.jenkins.support.api.FilePathContent) Computer(hudson.model.Computer) SystemPlatform(com.cloudbees.jenkins.support.util.SystemPlatform) Map(java.util.Map) WeakHashMap(java.util.WeakHashMap)

Aggregations

FilePathContent (com.cloudbees.jenkins.support.api.FilePathContent)1 SystemPlatform (com.cloudbees.jenkins.support.util.SystemPlatform)1 FilePath (hudson.FilePath)1 Computer (hudson.model.Computer)1 Map (java.util.Map)1 WeakHashMap (java.util.WeakHashMap)1 Jenkins (jenkins.model.Jenkins)1