Jenkinsfile Philips Hue Light Notifier
See you build status change via Philips Hue light!
On build start the light turns Purple and blinks (for max 15 seconds), and then on build result:
- success -> light turns Green
- failure -> light turns Red
- unstable -> light turns Yellow
- aborted -> light turns dim White / Grey
Play with changing the color and other values in the Jenkinsfile to get your custom build groove going!
- Philips Hue Color Light
- Philips Hue Bridge
- Jenkins CI server
- Pipeline plugin suite
- A Multi-branch Pipeline Jenkins job for your code repo
- HTTP Request plugin
- Credentials Binding plugin (can be skipped)
In the Jenkinsfile (declarative Pipeline syntax) I coded HTTP requests to a Hue light via Hue API on the build status changes mention above.
Here are the steps to get it working for you:
- Find your desired light ID and update the variable value in the Jenkinsfile. Light IDs start from 1 and are basically in the order of your added lights to your Hue Bridge.
- Find out your Hue Bridge IP address and create a username for it.
- On Jenkins, add two secret text credentials for the Hue Bridge IP address and the username. Then copy the associated credential IDs and paste them into the variable values in the Jenkinsfile. (NOTE: If you don't mind writing your IP address and username directly into the Jenkinsfile, you can skip 3. and remove the Credentials code and replace the $IP and $USER in the httpRequest url parameter in the Jenkinsfile.
Commit and push the changes to your VCS and build the Jenkins job for the code repo, and enjoy the light show!
This is the license for this code repo.
"Hue Personal Wireless Lighting" is a trademark owned by Koninklijke Philips Electronics N.V., see www.meethue.com for more information. I am in no way affiliated with the Philips organization.