• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java WorkspaceList类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中hudson.slaves.WorkspaceList的典型用法代码示例。如果您正苦于以下问题:Java WorkspaceList类的具体用法?Java WorkspaceList怎么用?Java WorkspaceList使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



WorkspaceList类属于hudson.slaves包,在下文中一共展示了WorkspaceList类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: decideWorkspace

import hudson.slaves.WorkspaceList; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
protected WorkspaceList.Lease decideWorkspace(Node n, WorkspaceList wsl)
    throws InterruptedException, IOException {
  final YamlProject project = YamlBuild.this.getParent();
  final WorkspaceList.Lease lease = project.shareWorkspace(n);
  return (lease != null) ? lease : super.decideWorkspace(n, wsl);
}
 
开发者ID:jenkinsci,项目名称:yaml-project-plugin,代码行数:9,代码来源:YamlBuild.java


示例2: getParentWorkspaceLease

import hudson.slaves.WorkspaceList; //导入依赖的package包/类
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());
}
 
开发者ID:groupon,项目名称:DotCi,代码行数:12,代码来源:DynamicSubBuild.java


示例3: decideWorkspace

import hudson.slaves.WorkspaceList; //导入依赖的package包/类
@Override
protected Lease decideWorkspace(final Node n, final WorkspaceList wsl) throws InterruptedException, IOException {
    final Lease baseLease = getParentWorkspaceLease(n, wsl);
    final FilePath baseDir = baseLease.path;
    final EnvVars env = getEnvironment(this.listener);
    env.putAll(getBuildVariables());
    final String childWs = getParent().getName();
    return Lease.createLinkedDummyLease(baseDir.child(env.expand(childWs)), baseLease);
}
 
开发者ID:groupon,项目名称:DotCi,代码行数:10,代码来源:DynamicSubBuild.java


示例4: tempDir

import hudson.slaves.WorkspaceList; //导入依赖的package包/类
private static FilePath tempDir(FilePath ws) {
    return ws.sibling(ws.getName() + System.getProperty(WorkspaceList.class.getName(), "@") + "tmp");
}
 
开发者ID:10000TB,项目名称:Jenkins-Plugin-Examples,代码行数:4,代码来源:PwdStep.java


示例5: Callback

import hudson.slaves.WorkspaceList; //导入依赖的package包/类
Callback(StepContext context, WorkspaceList.Lease lease) {
    this.context = context;
    this.lease = lease;
}
 
开发者ID:jenkinsci,项目名称:external-workspace-manager-plugin,代码行数:5,代码来源:ExwsExecution.java


示例6: decideWorkspace

import hudson.slaves.WorkspaceList; //导入依赖的package包/类
/**
 * This function will check if the parent project is set up to
 * construct the workspace path from a string containing assigned
 * variables, instead of a fixed path.
 * <p>
 * This means that multiple projects can share their workspace, as long
 * as they use the same parameter values. This is highly useful for
 * projects that have to check-out code from large repositories or are
 * making use of a lot of common files.
 * <p>
 * If the project does not have the property set, it falls back to the
 * native Jenkins approach.
 * <p>
 * TODO: This might be useful to be sent upstream as a Jenkins-core
 * feature!
 */
@Override
protected Lease decideWorkspace(Node n, WorkspaceList wsl) throws InterruptedException, IOException {
	//Check if a parameter itself sets the workspace path
	for (ParameterValue pv : this.getParameterValues()) {
		if (!(pv instanceof StringParameterValue)) {
			continue;
		}
		StringParameterValue spv = (StringParameterValue) pv;
		if (spv.getName().equalsIgnoreCase("WORKSPACE_REUSE_PATH")) {
			//Fetch the workspace (do not care about locking)
			return Lease.createDummyLease(
					new FilePath(n.getChannel(), spv.value)
			);
		}
	}
	
	//Check if we deal with an inheritance job
	Job<?, ?> job = this.getProject();
	if (job == null && !(job instanceof InheritanceProject)) {
		//Invalid job; fall-back
		return super.decideWorkspace(n, wsl);
	}
	InheritanceProject ip = (InheritanceProject) job;
	
	//Check if a custom workspace is demanded
	String customWorkspace = ip.getCustomWorkspace();
	if (customWorkspace != null) {
		//The parent knows what to do
		return super.decideWorkspace(n, wsl);
	}
	
	//Calling the static workspace path finder
	FilePath ws = InheritanceBuild.getWorkspacePathFor(
			n, ip,
			this.getBuild().getEnvironment(this.getListener())
	);
	if (ws == null) {
		return super.decideWorkspace(n, wsl);
	}
	
	//We have the path; create a variable Lease
	return wsl.allocate(ws, getBuild());
}
 
开发者ID:i-m-c,项目名称:jenkins-inheritance-plugin,代码行数:60,代码来源:InheritanceBuild.java


示例7: shareWorkspace

import hudson.slaves.WorkspaceList; //导入依赖的package包/类
/**
 * Projects that delegate often have a largely cosmetic workspace,
 * based on which logic/control decisions are made, e.g. how to build
 * up a DSL project from its checked in code.  To minimize the impact
 * of these read-only workspaces in the presence of composition, attempt
 * to share our workspace with a parent job, if it has a workspace on
 * the node on which we have been scheduled.  This should be called from
 * {@code decideWorkspace}.
 * <p>
 * NOTE: public so that it is accessible to builds.
 *
 * @param onNode The Node we've been scheduled on.
 * @return A lease on the workspace to share, or null if no such workspace
 * exists on this node.
 */
@Nullable
public WorkspaceList.Lease shareWorkspace(Node onNode) {
  final FilePath workspace = _shareWorkspace(onNode);
  return workspace == null ? null :
      WorkspaceList.Lease.createDummyLease(workspace);
}
 
开发者ID:jenkinsci,项目名称:yaml-project-plugin,代码行数:22,代码来源:AbstractBranchAwareProject.java


示例8: tempDir

import hudson.slaves.WorkspaceList; //导入依赖的package包/类
/**
 * Calculates a temporary dir path
 *
 * @param ws current workspace
 * @return the temporary dir
 */
private static FilePath tempDir(FilePath ws) {
    return WorkspaceList.tempDir(ws);
}
 
开发者ID:jenkinsci,项目名称:pipeline-maven-plugin,代码行数:10,代码来源:WithMavenStepExecution.java



注:本文中的hudson.slaves.WorkspaceList类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Feature类代码示例发布时间:2022-05-22
下一篇:
Java Ethernet类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap