Kassis Netz / blog

Last time I installed dashing to the raspberry pi, this time I want to fill it with meaningful data so that it can do meaningful things.

I will add a couple of jenkins build status monitors.

As said, last time I installed dashing directly to the pi. This was to show what’s needed to actually run it and show it in kiosk mode.
To configure our board we probably wille have to write some code and add it to the project so it’s best to do this on a local machine first – simply because it’s more fluid and we usually have all the development tools around. So let’s start and jump to some dev space directory.

As you may see, I like to point out the actual command I’ve run to create or change things if it’s been done by a command like that – for reference and self learning.
Having several shells open I choose one to run it as a daemon

This step can be omitted once my pull request has been merged and published.

Now that we have seen a demo, let’s do something useful.
For the sake of simplicity, we will reuse the existing sample.erb dashboard, but you can also rename it to something different.
However you have to be careful at least a bit. Maybe you noticed that we just opened http://localhost:3030/ and it immediately redirected us to http://localhost:3030/sample. Why is that? You can search through the code but you won’t find it. That’s because dashing redirects on requests to / to the dashboard given as default*dashboard or if this is not set to the first one found – which is the first file found in dashboards in alphabetical order excluding the layout.
So when you rename it, keep this in mind since there’s also a sampletv.erb file present.

For now we just empty our sample dashboard by just leaving the following code inside:

would for add a job for the master build. Repeat this step for all jenkins builds to monitor.
Next configure the builds in jobs/jenkins_builds.rb near the top

×

–

⬈

JENKINS_URI=URI.parse("http://localhost:8080/")job_mapping={# id used in dashboard => { job: name of job }'jenkins_www_kluks_de_master'=>{job: 'www_kluks_de_master'},# repeat for all jobs added to the dashboard}

That’s for the simple configuration. You can add more tweaks to the job to e.g. get a release candidate number built by one job or that like. Just pass it inside send_event and use it in the widgets/jenkins_build/jenkins_build.html.