Dashing widget to display a Jenkins build status and build progress
This extension adds html5 audio alerts to the generated html dashboard. An alert will be played for each instance of the widget, but only if the state has changed. One sound for success, and one for failure.
This widget is a fork of Marco's work
The widget is based on the meter-widget which is default in the Dashing installation
The widget can also see the progress of a "pre-build", i.e if you have a job triggering the actual build you want to define, you can configure this job in the jenkins_build.rb as a prebuild.
For more information, please see Coding Like a tosser
Put the files jenkins_build.coffee
, jenkins_build.html
and jenkins_build.scss
goes in the /widget/jenkins_build
directory and the jenkins_build.rb
in the /jobs
directory. The javascript files should be placed in the /assets/javascripts
directory. The failure.wav and success.wav (not supplied) should be placed in the /public
directory.
Change the JENKINS_URI
to your correct uri for Jenkins, eg.:
JENKINS_URI = URI.parse("http://ci.yourserver.com")
Add jenkins credential (if required) in JENKINS_AUTH, eg.:
JENKINS_AUTH = {
'name' => 'username',
'password' => 'password'
}
Put all the jobnames and pre job names in the job_mapping
, eg.:
job_mapping = {
'job1' => { :job => 'Job Name 1'},
'job2' => { :job => 'Job Name 2', :pre_job => 'Job Name 3'},
}
Put the following in your dashingboard.erb file to show the status:
<li data-row="1" data-col="1" data-sizex="1" data-sizey="1">
<div data-id="job1" data-view="JenkinsBuild" data-title="Build title" data-description="A little description of build" data-min="0" data-max="100"></div>
</li>
Multiple jobs can add in dashboard repeating the snippet and changing data-id
in accord with job name specified in job_mapping
. Widget support title and description via data attributes, this attributest can be omitted if you do not like to display this information.