Jenkins job status - Customize color / status of job
Asked Answered
T

3

8

Is there a way to customize the status of a Jenkins job to use different icons or colors other than just simple blue/green ball icons.

Something like what we see in cloudbees Jenkins instance or similar.

https://jenkins.ci.cloudbees.com/

For more (if possible), I'd like an option to have the ball status for a queued build job to change to a different color or icon. For example, a clock/stop-watch or an hour glass, or maybe change the color to a clear white sphere. This would help new users avoid accidentally launching a queued build multiple times expecting the job status icon to start flashing and etc.

Tumbleweed answered 19/8, 2015 at 22:30 Comment(0)
T
11

The following plugins can help to achieve what I'm looking for (to some degree).

  1. https://plugins.jenkins.io/modernstatus/ (I'll poke around in this plugin to see if I can change this "Modern Status" plugin -- to change the icon(s) for ex: change icon to a pending/hour glass icon if a build is sitting in "queue" and etc).

  2. https://github.com/kralq/distinguishable-gray-balls-plugin

  3. https://plugins.jenkins.io/custom-job-icon/ (as Mike mentioned in the other reply) - to classify a job type (using various icons).

Tumbleweed answered 20/8, 2015 at 15:1 Comment(1)
I knew of Green Balls, but avoided it because I don't want to make people tell me they can't differentiate red and green. The Modern Status plugin is almost exactly what I wanted.Pothole
S
3

The answer seems to be in their code for BallColor.java.

At the time of this writing, here are all the possible values:

RED("red",Messages._BallColor_Failed(), ColorPalette.RED),
RED_ANIME("red_anime",Messages._BallColor_InProgress(), ColorPalette.RED),
YELLOW("yellow",Messages._BallColor_Unstable(), ColorPalette.YELLOW),
YELLOW_ANIME("yellow_anime",Messages._BallColor_InProgress(), ColorPalette.YELLOW),
BLUE("blue",Messages._BallColor_Success(), ColorPalette.BLUE),
BLUE_ANIME("blue_anime",Messages._BallColor_InProgress(), ColorPalette.BLUE),
GREY("grey",Messages._BallColor_Pending(), ColorPalette.GREY),
GREY_ANIME("grey_anime",Messages._BallColor_InProgress(), ColorPalette.GREY),
DISABLED("disabled",Messages._BallColor_Disabled(), ColorPalette.GREY),
DISABLED_ANIME("disabled_anime",Messages._BallColor_InProgress(), ColorPalette.GREY),
ABORTED("aborted",Messages._BallColor_Aborted(), ColorPalette.GREY),
ABORTED_ANIME("aborted_anime",Messages._BallColor_InProgress(), ColorPalette.GREY),
NOTBUILT("nobuilt",Messages._BallColor_NotBuilt(), ColorPalette.GREY),
NOTBUILT_ANIME("nobuilt_anime",Messages._BallColor_InProgress(), ColorPalette.GREY),

I was pointed to the answer from here.

Sarsenet answered 21/4, 2017 at 19:22 Comment(0)
P
2

Short answer:

With coding it's possible. And then there's also the Custom Job Icon Plugin.

Long answer:

I dealt with the Greenballs plugin changing the testresult trend chart to an ugly green. Thus I forked it and changed the color value.

In the project there were greenball icons. With some additional logic you may specify the icon being displayed depending on the status.

Note that this was not tested with Hudson, but only Jenkins.

Poliard answered 20/8, 2015 at 7:41 Comment(2)
Thanks Mike. I'll try that Custom Job Icon plugin. One of my colleague also found similar, I'll share.Tumbleweed
Actually this plugin is just putting an icon to represent the TYPE of a job (i.e. for a build job, I can give icon O, for a deploy job I can give icon Y and report/etc job I can give another icon X etc). I'm also looking at the custom work you did (greenballs icons) link you provided (in Github). I'll play around with it. The Custom job plugin doesn't change the blue/green balls status icons (but allows us to visually represent/classify various types of jobs).Tumbleweed

© 2022 - 2024 — McMap. All rights reserved.