本文整理汇总了Java中hudson.model.AbstractBuild.getPreviousCompletedBuild方法的典型用法代码示例。如果您正苦于以下问题:Java AbstractBuild.getPreviousCompletedBuild方法的具体用法?Java AbstractBuild.getPreviousCompletedBuild怎么用?Java AbstractBuild.getPreviousCompletedBuild使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类hudson.model.AbstractBuild
的用法示例。
在下文中一共展示了AbstractBuild.getPreviousCompletedBuild方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: completed
import hudson.model.AbstractBuild; //导入方法依赖的package包/类
public void completed(AbstractBuild r) {
AbstractProject<?, ?> project = r.getProject();
if(project == null) return;
Result result = r.getResult();
AbstractBuild<?, ?> previousBuild = project.getLastBuild();
if(previousBuild == null) return;
do {
previousBuild = previousBuild.getPreviousCompletedBuild();
} while (previousBuild != null && previousBuild.getResult() == Result.ABORTED);
Result previousResult = (previousBuild != null) ? previousBuild.getResult() : Result.SUCCESS;
if ((result == Result.ABORTED && notifier.getNotifyAborted())
|| (result == Result.FAILURE //notify only on single failed build
&& previousResult != Result.FAILURE
&& notifier.getNotifyFailure())
|| (result == Result.FAILURE //notify only on repeated failures
&& previousResult == Result.FAILURE
&& notifier.getNotifyRepeatedFailure())
|| (result == Result.NOT_BUILT && notifier.getNotifyNotBuilt())
|| (result == Result.SUCCESS
&& (previousResult == Result.FAILURE || previousResult == Result.UNSTABLE)
&& notifier.getNotifyBackToNormal())
|| (result == Result.SUCCESS && notifier.getNotifySuccess())
|| (result == Result.UNSTABLE && notifier.getNotifyUnstable())) {
getTelegram(r).publish(getBuildStatusMessage(r, notifier.includeTestSummary(),
notifier.getIncludeFailedTests(),notifier.includeCustomMessage()), getBuildColor(r));
}
}