Skip to content
Permalink
Browse files

JENKINS-39714: No badge shown for unstable builds

Yellow badge is now shown for unstable builds as well as the currently
running release build.
  • Loading branch information
shillner committed Nov 15, 2016
1 parent 52890a9 commit cc155677db0206a541b1b596b4b11046e5ec76a8
Binary file not shown.
@@ -93,6 +93,16 @@ public boolean isFailedBuild() {
return false;
}

public boolean isUnstableBuild() {
if (this.run != null) {
Result result = this.run.getResult();
if (result != null) {
return result.isBetterOrEqualTo(Result.UNSTABLE) && result.isWorseOrEqualTo(Result.UNSTABLE);
}
}
return false;
}

public boolean isBuilding() {
return this.run.isBuilding();
}
@@ -359,7 +359,7 @@ public void buildEnvVars(Map<String, String> env) {
public boolean tearDown(AbstractBuild build, BuildListener listener) throws IOException, InterruptedException {
int lockedBuilds = 0;
Result result = build.getResult();
if (result != null && result.isBetterOrEqualTo(Result.SUCCESS)) {
if (result != null && result.isBetterOrEqualTo(Result.UNSTABLE)) {
if (UnleashMavenBuildWrapper.this.numberOfBuildsToLock != 0) {
build.keepLog();
lockedBuilds++;
@@ -383,7 +383,7 @@ private boolean isSuccessfulReleaseBuild(Run run) {
UnleashBadgeAction badgeAction = run.getAction(UnleashBadgeAction.class);
if (badgeAction != null && !run.isBuilding()) {
Result result = run.getResult();
if (result != null && result.isBetterOrEqualTo(Result.SUCCESS)) {
if (result != null && result.isBetterOrEqualTo(Result.UNSTABLE)) {
return true;
}
}
@@ -1,11 +1,14 @@
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core">
<j:choose>
<j:if test="${it.isSuccessfulBuild()}">
<j:when test="${it.isSuccessfulBuild()}">
<img width="16" height="16" title="${it.tooltipText}" src="${rootURL}/plugin/unleash/img/badge-success.png"/>
</j:if>
<j:if test="${it.isFailedBuild()}">
</j:when>
<j:when test="${it.isFailedBuild()}">
<img width="16" height="16" title="${it.tooltipText}" src="${rootURL}/plugin/unleash/img/badge-failure.png"/>
</j:if>
</j:when>
<j:otherwise>
<img width="16" height="16" title="${it.tooltipText}" src="${rootURL}/plugin/unleash/img/badge-unstable.png"/>
</j:otherwise>
</j:choose>
</j:jelly>
Binary file not shown.

0 comments on commit cc15567

Please sign in to comment.
You can’t perform that action at this time.