An Arduino driven project that controls lights to signal the status of a Jenkins job.
This project was made during an internal hackathon I competed in as an intern at Zix. It is a visualizer for Jenkins builds that is designed to be utilized by development and DevOPs teams. The LED indicators will change color, reflecting the current status of the build. If the status changes an optional email notification can be sent to a individual or a mailing list, enabling it to be a useful tool for entire teams.
Jenkins-CI-Traffic-Light was built with the following libraries and resources
Required resources
- Arduino Uno
- Red, Yellow, and Green LED
- Breadboard
- Jumper Wires
- 330Ω Resistors
The setup is entirely up to the installer, but I have a photo of my setup incase you would like to mirror it.
Windows, OS X & Linux:
git clone https://github.com/ryancorridor/Jenkins-CI-Traffic-Light.git
To actually configure the script to get it running properly, the process is actually not that long. After cloning the repository all you will need to install the one dependency, PyFirmata, and make the Python script executable.
pip install pyfirmata
chmod +x trafficlight.py
There are some further changes that need to be made directly in the script before it can be run. For security reasons I have stripped out any Jenkins servers I used for development and left sample variables instead.
This code block can be found near the top of the script. Change the <insert_blank>
strings with your specific values. If you are confused about what values to put for board_serial_port or pin_number refer to the PyFirmata documentation.
(e.g. '<insert_board_serial_port_here>'
-> /dev/cu.usbmodemFD131
)
board = Arduino('<insert_board_serial_port_here>')
LEDS = {
"red": board.get_pin('d:<insert_pin_number_here>:o'),
"yellow": board.get_pin('d:<insert_pin_number_here>:o'),
"green": board.get_pin('d:<insert_pin_number_here>:o')
}
JENKINS_SERVERS = {
'<insert_server_name_here>': '<insert_server_url_here>',
}
EMAIL_RELAY = '<insert_email_relay_here>'
EMAIL_SENDER = '<insert_email_sender_here>'
To use the CLI to browse Jenkins builds:
./trafficlight.py
If you know what parameters you need:
./trafficlight.py server job build [-e EMAIL]
*Email is an optional feature. If you wish to not have it enabled, just do not include it in your arguments
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE
for more information.
Ryan Hall - @ryancorridor - [email protected]
Project Link: https://github.com/ryancorridor/bullwinkle