A Jenkins monitor for the Mesosphere office. This application assumes your Jenkins server is reachable and that you are running a 32x32 display.
Inspired by sloth.
The following components are used in the monitor:
- Raspberry Pi 2
- Adafruit RGB LED HAT
- 32x32 RGB LED Matrix Panel - 6mm pitch (you can use a smaller pitch if you like)
- 5V, 2A DC power adapter for the HAT, 5V, 2A micro-usb adapter for the RPi
- Wireless adapter (if you don't want to use Ethernet)
The Adafruit tutorial is comprehensive.
- Clone this repo:
git clone [email protected]:ssk2/jenkins-monitor.git && cd jenkins-monitor
- Initialise the submodule:
git submodule init
- Update the module:
git submodule update
- Make the Adafruit shared object file:
cd adafruit && make clean rgbmatrix.so && cd ../
- Create an
__init__.py
file so we can import the newly created file:touch adafruit/__init__.py
- Run the script:
sudo python jenkins-monitor.py
You may like to set up a cron job to start this process up every day at a certain time. (It will exit itself at a specified UTC hour.)
First, open the crontab as root:
sudo crontab -e
Then add the line below to the end, changing the schedule and file path to point to where you've cloned the repo. In this configuration, the script starts at 2pm UTC (or 8am Californian time):
0 14 * * 1-5 python /home/pi/jenkins-monitor/jenkins-monitor.py 2>&1 | /usr/bin/logger -t jenkins-monitor
Set JENKINS_URL
to point to the View you want this script to monitor.
The BAD_IMAGES
, GOOD_IMAGES
and NEUTRAL_IMAGES
arrays each point to local assets that should be shown when one or more builds are failing, no builds are failing or a build is running respectively.
You may need to specify a different font by setting FONT_PATH
to point to a font available on your system.
Images must be 32x32 in size. You can use imagemagick
to resize them from the command line:
sudo apt-get install imagemagick
mogrify -resize 32x32 image.jpg