Git Product home page Git Product logo

jenkins_light's Introduction

Jenkins Build Light

For the Delcom USB light model 904008

Changes the status of a Delcom USB light depending on the status of a Jenkins build and when pull requests are pending for a repository.

The light statuses:

  • Off when you abort the build
  • Green when the last build was a sucess
  • Blinky Green when a pull request is pending
  • Blinky Blue when Jenkins is building (it blinks faster the nearer the build get to completion)
  • Blinky Red when the last build failed
  • Orange when is does now understand the Jenkins status (unlikely but possible)

Some times you want the light to turn off (maybe because it is driving you crazy blinking red since the last build failed), of course you could just unplug it, but where is the fun in that - so instead, just send it either an email with shut up or wake up in the subject to turn it off, or back on again.

Here are some commands that you can send it via a message

  • "whats up" - lets it get on with doing what it should be doing
  • "how are you" - causes a fast succession of 10 blinks to tell you that it is a linve
  • "shut up" - turns off the light and stops doing anything else that might annoy you
  • "red light" - turns on the red light
  • "green light" - turns on the green light,
  • "blue light" - turns on the blue light,
  • "orange light" - turns on the red and green light
  • "turn off" - turns off the light
  • "turn on" - turns on the light with the last know color

Installation

You need to install ruby-usb first

prompt$: git clone [email protected]:digitaleseiten/ruby_usb.git

Important: Follow the installation instructions in the ruby-usb Readme file.

Then in a seperate folder.

prompt$: git clone [email protected]:digitaleseiten/jenkins_light.git

Configuration

There are three example.yml files in the root folder. One for Github and one for Jenkins. Enter in your information and rename them to github_credentials.yml, jenkins_credentials.yml and gmail_credentials.yml respectively. (I am sure that i works for all other pop mail providers, but I only tried it out with gmail)

NOTE: If you don't want to use the github or the gmail feature, then you can disable them in your github_credentials.yml and gmail_credentials.yml files.

Starting

From the root directory of the project, just run

jenkins_light

Useful Information

When Jenkins is building, the blink frequesncy of the light increases the closer it gets to the end of a build. This works because the length of successful builds are captured in a txt file in the data folder. When building for the first time - you might get a strange blink pattern.

Just to save you some time. There is some code out there for the Delcom light that used the libusb gem from git://github.com/larskanis/libusb.git - The nice thing about that is the libusb is a gem and it uses 1.0 version of libusb (now libusbx) - I would have loved to have used that instead of the ruby-usb which used the libusb-compat (which in turn uses the old version of libusb), but I am on a mac - and in this case its a bad thing. The Jenkins light is a HID device. HID devices get grabbed up by macosx and there is no simple way to get them released. ruby-usb with lib-compat some how got around that on the mac.

Looking for a Job in Berlin?

Drop us a line!!

jenkins_light's People

Contributors

mahijames avatar jasonfranklin-stokes avatar

Watchers

 avatar  avatar  avatar  avatar James Cloos avatar Mark  avatar Sam Barker avatar Justin Young avatar Ollie R avatar  avatar Zoltan Szel avatar Liam Cordelle avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.