Main Content

Broken CircleCI Builds and Particle Mesh

Display broken CircleCI builds with a Particle Mesh IoT network.

Instead of a scrolling marquee displaying unique messages, I wanted to only receive notifications when a continuous integration platform failed a build. Things that would be helpful in this notification would be, what branch failed and who was the user.

CircleCI is a great continuous integration platform that I use a lot for personal projects, however I sure this approach (or similar) will work with most.

The CircleCI config.yml allows you to call a command on “Build Failed”. This is great, because we can cURL a POST request to an API passing it our CIRCLE_BRANCH and CIRCLE_USERNAME. Easy!

Once additional spin on my approach with this project is that I wanted to use Particle Mesh Networking. Essentially, a Particle mesh network consists of a gateway device with network access, and one/may endpoint devices. A much better explanation can be found here on the Particle blog.

My example is going to use the Argon WiFi gateway device and 2 x Xenon endpoint devices.

Gateway and endpoint devices can communicate with each other by publishing or subscribing to events. Only devices on this network will have access to these events.

Knowing this, we can define a function on our gateway device (Argon) display_broken_build, which when called by the API, can then emit a custom event on our network matrix_display_message. Our endpoints, which will be subscribing to the event matrix_display_message, can then perform a specific action.

My plan is to have 1 Xenon endpoint operate a scrolling marquee, while the other Xenon endpoint displays a tally of the amount of broken builds. What this showcases is that in a workplace environment, we could have multiple devices on our network displaying notifications of broken builds and perhaps more detailed statistics.”

Link to article

Related Content