This project periodically fetches the latest GitLab CI/CD pipeline run and signals its status (e.g., idle, running, completed successfully, failed). It performs the lookup using the GitLab REST API.
The following video shows the project live in action.
demo.mp4
Based on the mentioned equipment kit, the following components are necessary:
- Raspberry Pi Pico W
- 3 LEDs
- 3 x 220 Ohm resistors
The setup consists of three circuits. Each circuit uses a GPIO (General Purpose Input/Output) pin as a power supply, connects to an LED and a consistor, and settles to the ground (GND).
Based on the initial and already mentioned Thonny setup, the following source files are required:
- main.py: It runs the application.
- secrets.py: It contains credentials and sensitive information.
Installation:
- Rename
example.secrets.py
tosecrets.py
and adjust the values. - Store both files in the same directory on the Pico.
- Run the file
main.py
.
Now, the LED should visualize the idle mode. If a pipeline gets executed, the LED mode switches after a maximum of 10 seconds by blinking the yellow LED. If the pipeline is completed, the green or red LED lights up for approximately one minute. After that, the LEDs are back in idle mode and waiting for the subsequent execution.
- Basic circuit to power an LED
- Importance of a resistor in this circuit
- The reason why the order of series connection is independent (reference)
- The amperage stays the same in a series connection, and only the voltage drops at the resistor.
- A specific amperage value must be met to avoid burning the LED.
- There is no non-blocking implementation of the module
urequests
as discussed here. Therefore, the LEDs pause while the HTTP request is made.