本文整理汇总了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);
}
示例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);
}
示例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;
}
示例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();
}
示例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();
}