In our build envirnoment, we wanted to show the current build status of our pipeline on a hardware traffic build light.
- A hardware traffic build light from https://www.vanheusden.com/clewarecontrol/
- The official clewarecontrol driver and tools from https://www.vanheusden.com/clewarecontrol/files
- node-js and npm
- Checkout the repository
- Install the clewarecontrol tools downloaded from above (and make sure 'clewarecontrol' is in the PATH)
- Run start.sh as sudo(!). The server should startup on port 54321 by default
To set the lights, just open a browser and trigger the URL:
http://localhost:54321/<trafficLightIdentifier>/<state>
trafficLightIdentifier:
- one of 'qa' or 'dev'. Maps to the device id which can be retrieved by executing
clewarecontrol -l
state:
- 'off' = turns all lights off
- 'ok' = turns only the green light on
- 'nok' = turns only the red light on
- 'building' = turns the yellow light on (and keeps the other lights unchanged)
- 'warn' = turns all lights on
You can change the server port by providing a command line parameter to the start.sh script. e.g.
> sudo ./start.sh 8181
will start up the server on port 8181.