Repository is archived
No commit activity in last 3 years
No release in over 3 years
Fetches Jobs from a Jenkins CI via the REST JSON API and sets LEDs of an Extreme Feedback Device to the status of the corresponding Job. Build and designed for running on a Raspberry Pi with Debian 7.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.3
~> 0.9
~> 10.1
~> 2.14

Runtime

~> 1.4
~> 1.1
~> 0.3
 Project Readme

ExtremeFeedbackDevice

Gem Version Build Status Dependency Status

TODO: Write a gem description

Fetches Jobs from a Jenkins CI via the REST JSON API and sets LEDs of an Extreme Feedback Device to the status of the corresponding Job.

Tested with Ruby v2.0.0p247 running on Raspberry Pi with Raspbian "wheezy" / Debian GNU/Linux 7 "wheezy".

Prepare

To get read-write permissions for the SPI-Device with udev you can add the following rule:

# /etc/udev/rules.d/99-spidev.rules
SUBSYSTEM=="spidev", GROUP="spidev", MODE="0660"

For this you first need to create a group spidev (as root):

$ groupadd spidev

Add your user to the new group (as root):

$ adduser foo spidev

After this, do a restart or run the following commands (as root):

$ udevadm control --reload-rules
$ udevadm trigger --subsystem-match=spidev

Installation

Add this line to your application's Gemfile:

gem 'extreme_feedback_device'

And then execute:

$ bundle

Or install it yourself as:

$ gem install extreme_feedback_device

Settings

TODO: Write configuration instruction here

The default location for the settings file is: $HOME/.extreme_feedback_device.yml

  • jenkins.*: ...
  • infinite_loop.sleep: the time (in seconds) to sleep between each request.
  • pi.num_leds: the number of LEDs on your attached Extreme Feedback Device.
  • pi.map_leds: the mapping of LEDs (with LED's index) to Jenkins Jobs (with Job's name).
  • spi.devive: the SPI Device to write on.

Example

default:
  jenkins:
    user: api
    token: 0123456789ABCDEF
    url: http://jenkins.example.com/
  infinite_loop:
    sleep: 5
  pi:
    num_leds: 2
    map_leds:
      i_1: Jenkins - Master
      i_0: Jenkins - Production
  spi:
    device: /dev/spidev0.0

Usage

Output of extreme_feedback_device --help:

extreme_feedback_device [OPTION] ...

-h, --help:
  show help.

-m, --mode [run]:
  set mode 'run' for a single run or 'loop' for infinite loop.

-n, --namespace [default]:
  settings namespace.

-p, --pid [~/.extreme_feedback_device.pid]:
  pid file.

-s, --settings [~/.extreme_feedback_device.yml]:
  settings file.

-v, --version:
  show version.

Daemon

Copy the example init.d script and change it for your needs (as root):

$ cp `gem contents extreme_feedback_device | grep vendor/init.d/extreme_feedback_device` /etc/init.d/extreme_feedback_device
$ chmod u+x /etc/init.d/extreme_feedback_device
$ vim /etc/init.d/extreme_feedback_device

If you want to start the daemon automatically on boot (as root):

$ update-rc.d extreme_feedback_device defaults

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request