本文整理了Java中hudson.model.Node.getRootPath()
方法的一些代码示例,展示了Node.getRootPath()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Node.getRootPath()
方法的具体详情如下:
包路径:hudson.model.Node
类名称:Node
方法名:getRootPath
[英]Gets the root directory of this node.
Hudson always owns a directory on every node. This method returns that.
[中]获取此节点的根目录。
Hudson在每个节点上都拥有一个目录。这个方法返回。
代码示例来源:origin: jenkinsci/jenkins
public ZFSProvisioner(Node node) throws IOException, InterruptedException {
rootDataset = node.getRootPath().act(new GetName());
}
private static class GetName extends MasterToSlaveFileCallable<String> {
代码示例来源:origin: jenkinsci/jenkins
@Override
protected Callable<DiskSpace, IOException> createCallable(Computer c) {
Node node = c.getNode();
if (node == null) return null;
FilePath p = node.getRootPath();
if(p==null) return null;
return p.asCallableWith(new GetUsableSpace());
}
};
代码示例来源:origin: jenkinsci/jenkins
@Override
protected Callable<DiskSpace,IOException> createCallable(Computer c) {
Node node = c.getNode();
if (node == null) return null;
FilePath p = node.getRootPath();
if(p==null) return null;
return p.asCallableWith(new GetTempSpace());
}
}
代码示例来源:origin: jenkinsci/jenkins
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;
代码示例来源:origin: jenkinsci/jenkins
/**
* 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);
}
代码示例来源:origin: org.jenkins-ci.main/jenkins-core
public ZFSProvisioner(Node node) throws IOException, InterruptedException {
rootDataset = node.getRootPath().act(new MasterToSlaveFileCallable<String>() {
private static final long serialVersionUID = -2142349338699797436L;
public String invoke(File f, VirtualChannel channel) throws IOException {
ZFSFileSystem fs = libzfs.getFileSystemByMountPoint(f);
if(fs!=null) return fs.getName();
// TODO: for now, only support agents that are already on ZFS.
throw new IOException("Not on ZFS");
}
});
}
代码示例来源:origin: org.jenkins-ci.lib/xtrigger-lib
private boolean eligibleNode(Node node) {
if (node == null) {
return false;
}
if (node.getRootPath() == null) {
return false;
}
return node.getNumExecutors() != 0;
}
代码示例来源:origin: org.jvnet.hudson.main/hudson-core
public ZFSProvisioner(Node node) throws IOException, InterruptedException {
this.node = node;
rootDataset = node.getRootPath().act(new FileCallable<String>() {
public String invoke(File f, VirtualChannel channel) throws IOException {
ZFSFileSystem fs = libzfs.getFileSystemByMountPoint(f);
if(fs!=null) return fs.getName();
// TODO: for now, only support slaves that are already on ZFS.
throw new IOException("Not on ZFS");
}
});
}
代码示例来源:origin: hudson/hudson-2.x
public ZFSProvisioner(Node node) throws IOException, InterruptedException {
this.node = node;
rootDataset = node.getRootPath().act(new FileCallable<String>() {
public String invoke(File f, VirtualChannel channel) throws IOException {
ZFSFileSystem fs = libzfs.getFileSystemByMountPoint(f);
if(fs!=null) return fs.getName();
// TODO: for now, only support slaves that are already on ZFS.
throw new IOException("Not on ZFS");
}
});
}
代码示例来源:origin: org.jenkins-ci.main/jenkins-core
@Override
protected Callable<DiskSpace,IOException> createCallable(Computer c) {
Node node = c.getNode();
if (node == null) return null;
FilePath p = node.getRootPath();
if(p==null) return null;
return p.asCallableWith(new GetTempSpace());
}
}
代码示例来源:origin: org.jenkins-ci.main/jenkins-core
@Override
protected Callable<DiskSpace, IOException> createCallable(Computer c) {
Node node = c.getNode();
if (node == null) return null;
FilePath p = node.getRootPath();
if(p==null) return null;
return p.asCallableWith(new GetUsableSpace());
}
};
代码示例来源:origin: org.eclipse.hudson.main/hudson-core
protected DiskSpace getFreeSpace(Computer c) throws IOException, InterruptedException {
FilePath p = c.getNode().getRootPath();
if(p==null) return null;
return p.act(new GetUsableSpace());
}
};
代码示例来源:origin: org.eclipse.hudson.main/hudson-core
protected DiskSpace getFreeSpace(Computer c) throws IOException, InterruptedException {
FilePath p = c.getNode().getRootPath();
if(p==null) return null;
return p.act(new GetTempSpace());
}
};
代码示例来源:origin: hudson/hudson-2.x
protected DiskSpace getFreeSpace(Computer c) throws IOException, InterruptedException {
FilePath p = c.getNode().getRootPath();
if(p==null) return null;
return p.act(new GetUsableSpace());
}
};
代码示例来源:origin: org.jvnet.hudson.main/hudson-core
@Override
protected Lease decideWorkspace(Node n, WorkspaceList wsl) throws IOException, InterruptedException {
String customWorkspace = getProject().getCustomWorkspace();
if (customWorkspace != null) {
// we allow custom workspaces to be concurrently used between jobs.
return Lease.createDummyLease(n.getRootPath().child(getEnvironment(listener).expand(customWorkspace)));
}
return super.decideWorkspace(n, wsl);
}
代码示例来源:origin: org.jvnet.hudson.main/hudson-core
@Override
protected Lease decideWorkspace(Node n, WorkspaceList wsl) throws IOException, InterruptedException {
String customWorkspace = getProject().getCustomWorkspace();
if (customWorkspace != null)
// we allow custom workspaces to be concurrently used between jobs.
return Lease.createDummyLease(n.getRootPath().child(getEnvironment(listener).expand(customWorkspace)));
return super.decideWorkspace(n,wsl);
}
}
代码示例来源:origin: org.eclipse.hudson/hudson-core
@Override
protected Lease decideWorkspace(Node n, WorkspaceList wsl) throws IOException, InterruptedException {
String customWorkspace = getProject().getCustomWorkspace();
if (customWorkspace != null) {
// we allow custom workspaces to be concurrently used between jobs.
return Lease.createDummyLease(n.getRootPath().child(getEnvironment(listener).expand(customWorkspace)));
}
return super.decideWorkspace(n, wsl);
}
}
代码示例来源:origin: hudson/hudson-2.x
@Override
protected Lease decideWorkspace(Node n, WorkspaceList wsl) throws IOException, InterruptedException {
String customWorkspace = getProject().getCustomWorkspace();
if (customWorkspace != null) {
// we allow custom workspaces to be concurrently used between jobs.
return Lease.createDummyLease(n.getRootPath().child(getEnvironment(listener).expand(customWorkspace)));
}
return super.decideWorkspace(n, wsl);
}
代码示例来源:origin: hudson/hudson-2.x
@Override
protected Lease decideWorkspace(Node n, WorkspaceList wsl) throws IOException, InterruptedException {
String customWorkspace = getProject().getCustomWorkspace();
if (customWorkspace != null)
// we allow custom workspaces to be concurrently used between jobs.
return Lease.createDummyLease(n.getRootPath().child(getEnvironment(listener).expand(customWorkspace)));
return super.decideWorkspace(n,wsl);
}
}
代码示例来源:origin: groupon/DotCi
protected Lease getParentWorkspaceLease(final Node n, final WorkspaceList wsl) throws InterruptedException, IOException {
final DynamicProject mp = getParent().getParent();
final String customWorkspace = mp.getCustomWorkspace();
if (customWorkspace != null) {
// we allow custom workspaces to be concurrently used between
// jobs.
return Lease.createDummyLease(n.getRootPath().child(getEnvironment(this.listener).expand(customWorkspace)));
}
return wsl.allocate(n.getWorkspaceFor(mp), getParentBuild());
}
内容来源于网络,如有侵权,请联系作者删除!