POSTS

Chat Ops

Chat Ops is the practice of running your DevOps from within your chat tool, like IRC or Slack etc.

This post explains how you can implement ChatOps in your organization using Hubot.

In 2011 Github released Hubot, an open source chatbot which was modeled after their internal chatbot. Apparently, Github internally used this chatbot to push deployments to their production server.

Hubot can interface with many chat applications like Slack, IRC, HipChat and many more using Adapters. If you are using one of the popular chat applications, you should be able to easily find an adapter for that.

Traditionally, Slack integrations turned Slack channels into information sinks. We get notifications from Github that someone opened a PR, notifications from Jira that someone completed a task, notifications from Jenkins that a build was successfully completed etc. This can soon turn into information overload where your channel is so busy that it constantly keeps scrolling. And soon enough, you will learn that there is a mute button on Slack for muting notifications, because you just cant take the constant ding from that channel.

Hubot flips that around. With Hubot, you can turn your channel from an information sink into an information source.

Here is an example of using Hubot to start a Jenkins build: Jenkins screenshot

Please note that in our organization, we have named our Hubot as Synbot.

Since this can be a lot of words to type to start a build, we have created a shortcut using the hubot-shortcut module. Now the same job can easily be invoked by just typing !qa: Jenkins screenshot

Now when you see a notification from Jenkins that a job has started, you can read above to get a context of what happened and why the build was started: Jenkins screenshot

We have written a custom Jira plugin that allows you to run commands like this: Jenkins screenshot Jenkins screenshot

Apart from this, you can do fun stuff with various plugins for google map and google translate.

Hubot is written in NodeJS and CoffeeScript. If you know JavaScript, you can pick up CoffeeScript easily. Also, check out npmjs.com for thousands of Hubot plugins that can make your bot smarter.

You can find our source code at: https://github.com/synduit/synbot

Check out our custom scripts in the scripts/ folder.

I gave a talk about this at Drupal NYC Oct 2015 meetup. You can find the slides here.

Cue to 14m29s to see my talk.