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


Java Result.ABORTED属性代码示例

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


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

示例1: processBuildResult

void processBuildResult(boolean commentOnSuccess, boolean commentWithConsoleLinkOnFailure, boolean runHarbormaster) {
    if (result == Result.SUCCESS) {
        if (comment.length() == 0 && (commentOnSuccess || !runHarbormaster)) {
            comment.append("Build is green");
        }
    } else if (result == Result.UNSTABLE) {
        comment.append("Build is unstable");
    } else if (result == Result.FAILURE) {
        if (!runHarbormaster || commentWithConsoleLinkOnFailure) {
            comment.append("Build has FAILED");
        }
    } else if (result == Result.ABORTED) {
        comment.append("Build was aborted");
    } else {
        logger.info(UBERALLS_TAG, "Unknown build status " + result.toString());
    }
}
 
开发者ID:uber,项目名称:phabricator-jenkins-plugin,代码行数:17,代码来源:CommentBuilder.java

示例2: convertToTfsBuildResult

private BuildResult convertToTfsBuildResult(Result jenkinsResult) {
    if (jenkinsResult == Result.SUCCESS) {
        return BuildResult.SUCCEEDED;
    }

    if (jenkinsBuild.getResult() == Result.ABORTED) {
        return BuildResult.CANCELED;
    }

    // Assume FAILURE (and other cases that aren't successful)
    return BuildResult.FAILED;
}
 
开发者ID:Microsoft,项目名称:vsts-jenkins-build-integration-sample,代码行数:12,代码来源:TfsBuildFacadeImpl.java

示例3: convertToTfsTaskResult

private TaskResult convertToTfsTaskResult(Result jenkinsResult) {
    if (jenkinsResult == Result.SUCCESS) {
        return TaskResult.SUCCEEDED;
    }

    if (jenkinsBuild.getResult() == Result.ABORTED) {
        return TaskResult.CANCELED;
    }

    // Assume FAILURE (and other cases that aren't successful)
    return TaskResult.FAILED;
}
 
开发者ID:Microsoft,项目名称:vsts-jenkins-build-integration-sample,代码行数:12,代码来源:TfsBuildFacadeImpl.java

示例4: completed

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));

    }
}
 
开发者ID:FluffyFairyGames,项目名称:jenkins-telegram-plugin,代码行数:28,代码来源:ActiveNotifier.java

示例5: completed

public void completed(AbstractBuild r) {
	AbstractProject<?, ?> project = r.getProject();
	Result result = r.getResult();
	AbstractBuild<?, ?> previousBuild = project.getLastBuild();
	if (previousBuild != null) {
		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())) {
		String expandedCustomMessage = getExpandedCustomMessage(r);
		getMattermost(r).publish(getBuildStatusMessage(r, notifier.includeTestSummary(),
				notifier.includeCustomAttachmentMessage()), expandedCustomMessage, getBuildColor(r));
		if (notifier.getCommitInfoChoice().showAnything()) {
			getMattermost(r).publish(getCommitList(r), expandedCustomMessage, getBuildColor(r));
		}
	}
}
 
开发者ID:jovandeginste,项目名称:jenkins-mattermost-plugin,代码行数:31,代码来源:ActiveNotifier.java

示例6: getBuildStatus

static MessageStatus getBuildStatus(AbstractBuild r){
    if (r.isBuilding()) {
        return MessageStatus.STARTING;
    }
    Run previousSuccessfulBuild = null;
    Run previousBuild = null;
    Result result = r.getResult();
    Result previousResult;
    try {
        previousBuild = r.getProject().getLastBuild().getPreviousBuild();
        previousSuccessfulBuild = r.getPreviousSuccessfulBuild();
    }catch (NullPointerException npe){
       return MessageStatus.UNKNOWN;
    }

    boolean buildHasSucceededBefore = previousSuccessfulBuild != null;

    /*
     * If the last build was aborted, go back to find the last non-aborted build.
     * This is so that aborted builds do not affect build transitions.
     * I.e. if build 1 was failure, build 2 was aborted and build 3 was a success the transition
     * should be failure -> success (and therefore back to normal) not aborted -> success.
     */
    Run lastNonAbortedBuild = previousBuild;
    while(lastNonAbortedBuild != null && lastNonAbortedBuild.getResult() == Result.ABORTED) {
        lastNonAbortedBuild = lastNonAbortedBuild.getPreviousBuild();
    }


    /* If all previous builds have been aborted, then use
     * SUCCESS as a default status so an aborted message is sent
     */
    if(lastNonAbortedBuild == null) {
        previousResult = Result.SUCCESS;
    } else {
        previousResult = lastNonAbortedBuild.getResult();
    }

    /* Back to normal should only be shown if the build has actually succeeded at some point.
     * Also, if a build was previously unstable and has now succeeded the status should be
     * "Back to normal"
     */
    if (result == Result.SUCCESS
            && (previousResult == Result.FAILURE || previousResult == Result.UNSTABLE)
            && buildHasSucceededBefore) {
        return MessageStatus.BACK_TO_NORMAL;
    }
    if (result == Result.FAILURE && previousResult == Result.FAILURE) {
        return MessageStatus.STILL_FAILING;
    }
    if (result == Result.SUCCESS) {
        return MessageStatus.SUCCESS;
    }
    if (result == Result.FAILURE) {
        return MessageStatus.FAILURE;
    }
    if (result == Result.ABORTED) {
        return MessageStatus.ABORTED;
    }
    if (result == Result.NOT_BUILT) {
        return MessageStatus.NOT_BUILT;
    }
    if (result == Result.UNSTABLE) {
        return MessageStatus.UNSTABLE;
    }
    return MessageStatus.UNKNOWN;
}
 
开发者ID:FluffyFairyGames,项目名称:jenkins-telegram-plugin,代码行数:67,代码来源:ActiveNotifier.java

示例7: getStatusMessage

static String getStatusMessage(AbstractBuild r) {
	if (r.isBuilding()) {
		return STARTING_STATUS_MESSAGE;
	}
	Result result = r.getResult();
	Result previousResult;
	Run lastBuild = r.getProject().getLastBuild();
	Run previousBuild = (lastBuild != null) ? lastBuild.getPreviousBuild() : null;
	Run previousSuccessfulBuild = r.getPreviousSuccessfulBuild();
	boolean buildHasSucceededBefore = previousSuccessfulBuild != null;

	/*
	 * If the last build was aborted, go back to find the last non-aborted build.
	 * This is so that aborted builds do not affect build transitions.
	 * I.e. if build 1 was failure, build 2 was aborted and build 3 was a success the transition
	 * should be failure -> success (and therefore back to normal) not aborted -> success.
	 */
	Run lastNonAbortedBuild = previousBuild;
	while (lastNonAbortedBuild != null && lastNonAbortedBuild.getResult() == Result.ABORTED) {
		lastNonAbortedBuild = lastNonAbortedBuild.getPreviousBuild();
	}


	/* If all previous builds have been aborted, then use
	 * SUCCESS as a default status so an aborted message is sent
	 */
	if (lastNonAbortedBuild == null) {
		previousResult = Result.SUCCESS;
	} else {
		previousResult = lastNonAbortedBuild.getResult();
	}

	/* Back to normal should only be shown if the build has actually succeeded at some point.
	 * Also, if a build was previously unstable and has now succeeded the status should be
	 * "Back to normal"
	 */
	if (result == Result.SUCCESS
			&& (previousResult == Result.FAILURE || previousResult == Result.UNSTABLE)
			&& buildHasSucceededBefore) {
		return BACK_TO_NORMAL_STATUS_MESSAGE;
	}
	if (result == Result.FAILURE && previousResult == Result.FAILURE) {
		return STILL_FAILING_STATUS_MESSAGE;
	}
	if (result == Result.SUCCESS) {
		return SUCCESS_STATUS_MESSAGE;
	}
	if (result == Result.FAILURE) {
		return FAILURE_STATUS_MESSAGE;
	}
	if (result == Result.ABORTED) {
		return ABORTED_STATUS_MESSAGE;
	}
	if (result == Result.NOT_BUILT) {
		return NOT_BUILT_STATUS_MESSAGE;
	}
	if (result == Result.UNSTABLE) {
		return UNSTABLE_STATUS_MESSAGE;
	}
	return UNKNOWN_STATUS_MESSAGE;
}
 
开发者ID:jovandeginste,项目名称:jenkins-mattermost-plugin,代码行数:61,代码来源:ActiveNotifier.java

示例8: abortRunning

public synchronized int abortRunning(int number) throws IllegalAccessException {
        int aborted = 0;

        Computer[] computers = getJenkinsInstance().getComputers();
        for (Computer computer : computers) {
            if (isNull(computer)) {
                continue;
            }

            List<Executor> executors = computer.getExecutors();
            executors.addAll(computer.getOneOffExecutors());

            for (Executor executor : executors) {
                if (isNull(executor) || !executor.isBusy() || nonNull(executor.getCauseOfDeath()) ||
                        !getInterruptCauses(executor).isEmpty() || getInterruptStatus(executor) == Result.ABORTED) {
                    continue;
                }

                Queue.Executable executable = executor.getCurrentExecutable();
                final SubTask parent = executable.getParent();

                if (!(executable instanceof Run)) {
                    continue;
                }
                final Run executableRun = (Run) executable;

                if (!(parent instanceof Job)) {
                    continue;
                }
                final Job parentJob = (Job) parent;

                if (!parentJob.getFullName().equals(job.getFullName())) {
                    // name doesn't match
                    continue;
                }

                if (executableRun.getResult() == Result.ABORTED) {
                    // was already aborted
                    continue;
                }

                if (executableRun instanceof MatrixRun) {
                    // the whole MatrixBuild will be aborted
                    continue;
                }
//                if (executable instanceof MatrixBuild) {
//                    final MatrixBuild executable1 = (MatrixBuild) executable;
//                    executable1.doStop()
//                }

                final GitHubPRCause causeAction = (GitHubPRCause) executableRun.getCause(GitHubPRCause.class);
                if (nonNull(causeAction) && causeAction.getNumber() == number) {
                    LOGGER.info("Aborting '{}', by interrupting '{}'", executableRun, executor);
                    executor.interrupt(Result.ABORTED, new NewPRInterruptCause());
                    aborted++;
                }
            }
        }

        return aborted;
    }
 
开发者ID:KostyaSha,项目名称:github-integration-plugin,代码行数:61,代码来源:JobRunnerForCause.java


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