diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/org/jenkinsci/plugins/bbprb/BitbucketBuildListener.java | 10 | ||||
-rw-r--r-- | src/main/java/org/jenkinsci/plugins/bbprb/bitbucket/BuildState.java | 8 |
2 files changed, 9 insertions, 9 deletions
diff --git a/src/main/java/org/jenkinsci/plugins/bbprb/BitbucketBuildListener.java b/src/main/java/org/jenkinsci/plugins/bbprb/BitbucketBuildListener.java index 2b42ba3..15fe4ee 100644 --- a/src/main/java/org/jenkinsci/plugins/bbprb/BitbucketBuildListener.java +++ b/src/main/java/org/jenkinsci/plugins/bbprb/BitbucketBuildListener.java @@ -47,8 +47,14 @@ public class BitbucketBuildListener extends RunListener<AbstractBuild<?, ?>> { if (trigger != null) { LOGGER.log(Level.FINE, "Completed after BitbucketBuildTrigger"); Result result = build.getResult(); - BuildState state = (result == Result.SUCCESS) ? BuildState.SUCCESSFUL - : BuildState.FAILED; + BuildState state; + if (Result.SUCCESS == result) { + state = BuildState.SUCCESSFUL; + } else if (Result.ABORTED == result) { + state = BuildState.STOPPED; + } else { + state = BuildState.FAILED; + } BitbucketCause cause = build.getCause(BitbucketCause.class); trigger.setPRState(cause, state, build.getUrl()); } diff --git a/src/main/java/org/jenkinsci/plugins/bbprb/bitbucket/BuildState.java b/src/main/java/org/jenkinsci/plugins/bbprb/bitbucket/BuildState.java index 8fe1cdd..d070a35 100644 --- a/src/main/java/org/jenkinsci/plugins/bbprb/bitbucket/BuildState.java +++ b/src/main/java/org/jenkinsci/plugins/bbprb/bitbucket/BuildState.java @@ -1,9 +1,3 @@ package org.jenkinsci.plugins.bbprb.bitbucket; -/** - * Valid build states for a pull request - * - * @see - * "https://confluence.atlassian.com/bitbucket/buildstatus-resource-779295267.html" - */ -public enum BuildState { FAILED, INPROGRESS, SUCCESSFUL } +public enum BuildState { FAILED, INPROGRESS, SUCCESSFUL, STOPPED } |