LIFX Buildkite Build Light (Webtask)
Create a webhook endpoint in one line using webtask-cli:
Add a new webhook to your Buildkite organization with the webtask URL:
Step by step
1. Install the webtask-cli
npm install -h webtask-cli wt init
2. Create the webtask
wt create https://raw.githubusercontent.com/buildkite/lifx-buildkite-build-light-webtask/master/index.js \ --secret LIFX_ACCESS_TOKEN="[TOKEN FROM LIFX]" \ --param LIFX_BULB_SELECTOR="all"
LIFX_ACCESS_TOKENis a LIFX API token you generate from https://cloud.lifx.com/settings.
LIFX_BULB_SELECTORis LIFX API build selector to choose which bulbs to turn on (see LIFX developer docs for examples). The default is
WEBHOOK_TOKENis optional, and can be provided to verify the webhook came from Buildkite.
Copy the URL, and then start streaming your webtask’s logs:
3. Setup the webhook notification
Create a new webhook notification in Buildkite and paste in your webtask's URL: Organization Settings → Notifications → Webhooks → Add
Make sure to enable all the
build scopes, as well as the
ping (so you can see a ping notification in your
wt logs straight after saving your webhook).
All that's left is to trigger a build!
You can use the request logs on the bottom of the Buildkite webhook settings page to see the request to and response from your webtask, and you can use
wt logs to see the logs from your webtask container.
One bulb per project? One bulb per build pipeline step? A LIFX chandelier that twinkles rainbows after each deploy? The possibilities are endless!
Check out api.developer.lifx.com to see what’s possible with the API, then fork this project, and get hacking.
See the LICENSE file for license rights and limitations (MIT).