Skip to content

Latest commit

 

History

History
100 lines (72 loc) · 3.27 KB

README.md

File metadata and controls

100 lines (72 loc) · 3.27 KB

Build Light

Monitor the status of your continuous integration server with a Raspberry Pi powered traffic light. Build Light will regularly poll your CI server to check the status of yours jobs and update the color of the light accordingly:

  • Red - One or more builds has failed.
  • Yellow - One or more jobs is currently building.
  • Green - All jobs have successful builds.

Supported servers

Installation & Usage

Installation

Installation is managed through npm:

npm install build-light -g

Configuration

Configuration is controlled through environment variables (following the twelve-factor methodology). You should adjust the following environment variables to meet your needs:

Variable Description Default Value
JENKINS_BASE_URL The base URL of your Jenkins CI server. https://builds.apache.org
CHECK_INTERVAL The polling interval, in seconds. 900 (15 minutes)

In addition, the following variables may need to be adjusted based upon the physical wiring of your Raspberry Pi:

Variable Description Default Value
PIN_NUMBER_RED The GPIO pin that will be used to control the red light. 17
PIN_NUMBER_YELLOW The GPIO pin that will be used to control the yellow light. 27
PIN_NUMBER_GREEN The GPIO pin that will be used to control the green light. 22

Usage

Once installed and configured, build-light can be run as follows:

build-light

If you would like to run without global environment variables (or to override global variables) you can use env to run with a modified environment:

env JENKINS_BASE_URL=https://ci.example.com CHECK_INTERVAL=5 build-light

On supported operating systems, you can use the systemd service manager to setup the environment, manage when the application is started, and monitor the process to keep it running. This can be done with a system file like the one below:

[Unit]
Description=Toolhouse Build Light

[Service]
ExecStart=/usr/bin/build-light
Restart=always
User=root
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=build-light
Environment=JENKINS_BASE_URL=https://ci.example.com
Environment=CHECK_INTERVAL=5

[Install]
WantedBy=multi-user.target

In the wild

The build-light installation at Toolhouse: