show GoCD/cctray.xml status on a Raspberry Pi + a Unicorn HAT
- Raspberry Pi, i.e. 3
- Raspbian
- Unicorn HAT
pip install unicornhat
- this project
- A
cctray.xml
url. Snap CI or other cctray.xml providing tools (see ccmenu wiki) are expected to work as well.
sudo python poll.py <cctray.xml_url> <poll_wait_s>
- the cctray.xml URL can include basic authentication
- if the number of status entries exceeds the number of LEDs on the LED matrix (64, here), only the top level entries will be used.
- after the number of top level exceeds the number of LEDs, the input will be trimmed
Use a small HTTP server (based on Flask) listening to incoming arrays of status:
sudo python server.py
push status i.e. with httpie:
http post http://127.0.0.1:5500/update status:='["NONE","BUILDING","OK","ERROR","NONE","WHAT?"]' --auth ...
or write your own polling script taking poll.py as an example.
Valid status strings: NONE, BUILDING, ERROR, OK, UNKNOWN
The project can be built on GoCD using the new feature: pipeline configuration from source control #1133. For this, use:
- the gocd yaml config plugin
- this repository as primary material and as the pipeline definition
The pipeline configuration can be seen in ci.gocd.yaml
The GoCD XML config needs the following addition:
<config-repos>
<config-repo plugin="yaml.config.plugin">
<git url="https://github.com/d-led/gocd-rpi-unicorn-hat-monitor.git" />
</config-repo>
</config-repos>