args.add(node.getRemoteFS()); } else { args.add(workDirPath);
bldr.append(node.getRemoteFS()); } else { bldr.append(workDirPath);
String remoteFS = node.getRemoteFS(); if (Util.isRelativePath(remoteFS)) { remoteFS = channel.call(new AbsolutePath(remoteFS));
private String getRawSepFor(Slave sl) { if (sl == null) { return null; } return getRawSepFor(sl.getRemoteFS()); }
@CheckForNull private static String getWorkingDirectory(@CheckForNull Slave agent) { if (agent == null) { return null; } String workingDirectory = agent.getRemoteFS(); while (workingDirectory.endsWith("/")) { workingDirectory = workingDirectory.substring(0, workingDirectory.length() - 1); } return workingDirectory; }
@CheckForNull private static String getWorkingDirectory(@CheckForNull Slave slave) { if (slave == null) { return null; } String workingDirectory = slave.getRemoteFS(); while (workingDirectory.endsWith("/")) { workingDirectory = workingDirectory.substring(0, workingDirectory.length() - 1); } return workingDirectory; }
args.add(node.getRemoteFS()); } else { args.add(workDirPath);
bldr.append(node.getRemoteFS()); } else { bldr.append(workDirPath);
public Long getWorkspaceSize(Boolean containdedInWorkspace){ Long size = 0l; for(String nodeName: getSlaveWorkspaceUsage().keySet()){ Node node = Jenkins.getInstance().getNode(nodeName); String workspacePath = null; if(node instanceof Jenkins){ workspacePath = Jenkins.getInstance().getRawWorkspaceDir(); } if(node instanceof Slave){ workspacePath = ((Slave) node).getRemoteFS(); } if(workspacePath==null) continue; Map<String,Long> paths = getSlaveWorkspaceUsage().get(nodeName); for(String path: paths.keySet()){ if(containdedInWorkspace.equals(path.startsWith(workspacePath))){ size += paths.get(path); } } } return size; }
private boolean isContainedInWorkspace(TopLevelItem item, Node node, String path){ if(node instanceof Slave){ Slave slave = (Slave) node; return path.contains(slave.getRemoteFS()); } else{ if(node instanceof Jenkins){ FilePath file = Jenkins.getInstance().getWorkspaceFor(item); return path.contains(file.getRemote()); } else{ try{ return path.contains(node.getWorkspaceFor(item).getRemote()); } catch(Exception e){ return false; } } } }
final EnvVars cookie = _cookie = EnvVars.createCookie(); pb.environment().putAll(cookie); pb.environment().put("WORKSPACE", StringUtils.defaultString(computer.getAbsoluteRemoteFs(), node.getRemoteFS())); //path for local slave log
if (n==null || ch==null) return null; // defensive check FilePath root = new FilePath(ch, n.getRemoteFS()); FilePath agentExe = root.child("jenkins-slave.exe"); if (!agentExe.exists()) return null; // nothing to update
String path = computer.getNode().getRemoteFS(); if (path.indexOf(':')==-1) throw new IOException("Remote file system root path of the slave needs to be absolute: "+path); SmbFile remoteRoot = new SmbFile("smb://" + name + "/" + path.replace('\\', '/').replace(':', '$')+"/",createSmbAuth());
String path = computer.getNode().getRemoteFS(); if (path.indexOf(':')==-1) throw new IOException("Remote file system root path of the slave needs to be absolute: "+path); SmbFile remoteRoot = new SmbFile("smb://" + name + "/" + path.replace('\\', '/').replace(':', '$')+"/",createSmbAuth());
String remoteFs = getNode().getRemoteFS(); if(_isUnix && !remoteFs.contains("/") && remoteFs.contains("\\")) log.println("WARNING: "+remoteFs+" looks suspiciously like Windows path. Maybe you meant "+remoteFs.replace('\\','/')+"?"); FilePath root = new FilePath(channel,getNode().getRemoteFS());
String remoteFs = getNode().getRemoteFS(); if (_isUnix && !remoteFs.contains("/") && remoteFs.contains("\\")) { log.println("WARNING: " + remoteFs + " looks suspiciously like Windows path. Maybe you meant " + remoteFs.replace('\\', '/') + "?"); FilePath root = new FilePath(channel, getNode().getRemoteFS());
String remoteFs = getNode().getRemoteFS(); if(_isUnix && !remoteFs.contains("/") && remoteFs.contains("\\")) log.println("WARNING: "+remoteFs+" looks suspiciously like Windows path. Maybe you meant "+remoteFs.replace('\\','/')+"?"); FilePath root = new FilePath(channel,getNode().getRemoteFS());
String remoteFs = getNode().getRemoteFS(); if(_isUnix && !remoteFs.contains("/") && remoteFs.contains("\\")) log.println("WARNING: "+remoteFs+" looks suspiciously like Windows path. Maybe you meant "+remoteFs.replace('\\','/')+"?"); FilePath root = new FilePath(channel,getNode().getRemoteFS());
String remoteFS = node.getRemoteFS(); if (Util.isRelativePath(remoteFS)) { remoteFS = channel.call(new AbsolutePath(remoteFS));