当前位置: 首页>>代码示例>>Java>>正文


Java Job.getLastCompletedBuild方法代码示例

本文整理汇总了Java中hudson.model.Job.getLastCompletedBuild方法的典型用法代码示例。如果您正苦于以下问题:Java Job.getLastCompletedBuild方法的具体用法?Java Job.getLastCompletedBuild怎么用?Java Job.getLastCompletedBuild使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在hudson.model.Job的用法示例。


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

示例1: doTestIcon

import hudson.model.Job; //导入方法依赖的package包/类
/**
    * Serves the testCoverage badge image. TO DO
    * @param req
    * @param rsp
    * @param job
    * @return
    */
   @SuppressWarnings("rawtypes")
public HttpResponse doTestIcon(StaplerRequest req, StaplerResponse rsp, @QueryParameter String job) {
       Job<?, ?> project = getProject(job);
       Integer testPass = null;
       Integer testTotal = null;

       if (project.getLastCompletedBuild() != null) {
       	AbstractTestResultAction testAction =  project.getLastCompletedBuild().getAction(AbstractTestResultAction.class);
		if(testAction != null){
			int total = testAction.getTotalCount();
			int pass = total - testAction.getFailCount() - testAction.getSkipCount();
			
			testTotal = total;
			testPass = pass;
		}
       }
       return iconResolver.getTestResultImage(testPass, testTotal);
   }
 
开发者ID:SxMShaDoW,项目名称:embeddable-badges-plugin,代码行数:26,代码来源:PublicBadgeAction.java

示例2: doBuildDescriptionIcon

import hudson.model.Job; //导入方法依赖的package包/类
/**
 * Serves the Build Description badge image.
 * @param req
 * @param rsp
 * @param job
 * @return
 */
public HttpResponse doBuildDescriptionIcon(StaplerRequest req, StaplerResponse rsp, @QueryParameter String job) {
    Job<?, ?> project = getProject(job);
    String buildDescription = null;
    
    /*if (project.getLastSuccessfulBuild() != null) {
        buildDescription = project.getLastSuccessfulBuild().getDescription();
    }*/
    
    /*if (project.getLastBuild() != null) {
        buildDescription = project.getLastBuild().getDescription();
    }*/
    
    if (project.getLastCompletedBuild() != null) {
        buildDescription = project.getLastCompletedBuild().getDescription();
    }
    
    return iconResolver.getBuildDescriptionImage(buildDescription);
}
 
开发者ID:SxMShaDoW,项目名称:embeddable-badges-plugin,代码行数:26,代码来源:PublicBadgeAction.java

示例3: getResult

import hudson.model.Job; //导入方法依赖的package包/类
private Result getResult(View view) {
	Result ret = Result.SUCCESS;
	for (TopLevelItem item : view.getAllItems()) {
		for (Job<?,?> job : item.getAllJobs()) {
			Run<?, ?> build = job.getLastCompletedBuild();
			if(build != null) {
				Result result = build.getResult();
				if(result.isBetterOrEqualTo(Result.FAILURE)) 
					ret = ret.combine(result);
			}
		}
	}
	return ret;
}
 
开发者ID:baloise,项目名称:rocket-chat-notifier,代码行数:15,代码来源:ViewTracker.java

示例4: getDockerImagesUsedByJob

import hudson.model.Job; //导入方法依赖的package包/类
@Override public Collection<String> getDockerImagesUsedByJob(Job<?,?> job) {
    Run<?,?> build = job.getLastCompletedBuild();
    if (build != null) {
        ImageAction action = build.getAction(ImageAction.class);
        if (action != null) {
            Set<String> bareNames = new TreeSet<String>();
            for (String name : action.names) {
                bareNames.add(name./* strip any tag or hash */replaceFirst("[:@].+", ""));
            }
            return bareNames;
        }
    }
    return Collections.emptySet();
}
 
开发者ID:jenkinsci,项目名称:docker-workflow-plugin,代码行数:15,代码来源:ImageAction.java

示例5: previousAWSDeviceFarmBuildResult

import hudson.model.Job; //导入方法依赖的package包/类
/**
 * Returns the most recent AWS Device Farm test result from the previous build.
 *
 * @param job The job which generated an AWS Device Farm test result
 * @return The previous Device Farm build result.
 */
public static AWSDeviceFarmTestResult previousAWSDeviceFarmBuildResult(Job job) {
    Run prev = job.getLastCompletedBuild();
    if (prev == null) {
        return null;
    }
    AWSDeviceFarmTestResultAction action = prev.getAction(AWSDeviceFarmTestResultAction.class);
    if (action == null) {
        return null;
    }
    return action.getResult();
}
 
开发者ID:awslabs,项目名称:aws-device-farm-jenkins-plugin,代码行数:18,代码来源:AWSDeviceFarmUtils.java


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