Back to blog

Tweeting Travis CI build notifications via webhooks

If you aren’t familiar with Travis CI, you really ought to check it out. It’s a hosted continuous integration service that’s ridiculously easy to configure, can connect to your GitHub repositories with a single click, and supports a plethora of languages.

As I was developing my new responsive site, I thought it would be cool to tweet build notifications from my techie Twitter account, @jamesseanwright. After familiarising myself with Travis webhooks, I wrote a Node.js server that will receive said notifications and post build results to Twitter; the imaginatively named Twitter Webhook for Travis CI.

Setting it up is fairly straightforward using the provided README: create a Twitter app, authorise it against your Twitter account, host the server, configure the API keys, and make Travis aware of the webhook.

In the case of my new site, it will tweet upon a successful or failed build:

Hopefully someone will find this webhook useful. I’m open to pull requests and suggestions if it increases its ease of use!