Simple Dashing widget (and associated job) to display the current build status of a Jenkins server. When all jobs are fine a blue background with a thumbs-up icons is shown. When one or more jobs are in a failed state, they are listed on a red background. If culprits are available the user which has broken the build will also be shown. When the Speech Synthesis API is available on the browser it will say one of the predefined texts out loud every 5 minutes. See jenkins_build_status.coffee for the texts and the timeBetweenSounds parameter.
Calls are made to the Jenkins API to retrieve the build status and culprits if they are available.
Please leave a comment below or click on the star if you are using this widget :-)
Create the folder widgets/jenkins_build_status
and put these files in it:
jenkins_build_status.coffee
jenkins_build_status.html
jenkins_build_status.scss
Place the following file in your jobs/
folder:
jenkins_build_status.rb
There are a few parameters that must be set up before using this widget with your Jenkins instance.
In the jenkins_build_status.rb file, modify the following parameters according to your needs:
Parameter | Meaning |
---|---|
JENKINS_URI |
Jenkins base URL |
JENKINS_AUTH |
Jenkins user credentials |
To add this widget to your dashboard, add the following to your [Dashboard-filename].erb file:
<li data-row="1" data-col="1" data-sizex="2" data-sizey="1">
<div data-id="jenkinsBuildStatus" data-view="JenkinsBuildStatus" data-title="Jenkins"></div>
</li>
Hi Joe, (Thanks by the way)
I'm having the same problem described by ChethanaPuneeth, did you solve it? My widget keeps saying "All Jenkins builds are successful" with orange background, but in the log:
scheduler caught exception:
getaddrinfo: Name or service not known
/usr/lib/ruby/1.9.1/net/http.rb:763:in
initialize' /usr/lib/ruby/1.9.1/net/http.rb:763:in
open'/usr/lib/ruby/1.9.1/net/http.rb:763:in
block in connect' /usr/lib/ruby/1.9.1/timeout.rb:55:in
timeout'/usr/lib/ruby/1.9.1/timeout.rb:100:in
timeout' /usr/lib/ruby/1.9.1/net/http.rb:763:in
connect'/usr/lib/ruby/1.9.1/net/http.rb:756:in
do_start' /usr/lib/ruby/1.9.1/net/http.rb:745:in
start'/usr/lib/ruby/1.9.1/net/http.rb:1285:in
request' /home/dev/git/dashboard/jobs/jenkins_build_status.rb:66:in
getFromJenkins'/home/dev/git/dashboard/jobs/jenkins_build_status.rb:13:in
block in <top (required)>' /var/lib/gems/1.9.1/gems/rufus-scheduler-2.0.24/lib/rufus/sc/jobs.rb:230:in
call'/var/lib/gems/1.9.1/gems/rufus-scheduler-2.0.24/lib/rufus/sc/jobs.rb:230:in
trigger_block' /var/lib/gems/1.9.1/gems/rufus-scheduler-2.0.24/lib/rufus/sc/jobs.rb:204:in
block in trigger'/var/lib/gems/1.9.1/gems/rufus-scheduler-2.0.24/lib/rufus/sc/scheduler.rb:430:in
call' /var/lib/gems/1.9.1/gems/rufus-scheduler-2.0.24/lib/rufus/sc/scheduler.rb:430:in
block in trigger_job'Thanks
Sebastian