Slack is the latest hip tool that technology teams have come to depend on. Based on an idea eerily similar to Internet Relay Chat (IRC) that was extremely popular back in the mid-nineties, Slack allows teams to collaborate in web and app based chat rooms and is growing in popularity with enterprises as well as the smaller start-up world where it first took off, as larger businesses are realising that Slack provides a very neat audit trail through the log of the chats themselves.
Slack is extremely extensible, and this is where Hubot comes in. Slack is the perfect interface for Hubot as bots can be team members in Slack, appearing in chat rooms and interacting like everyone else.
Slack offers accounts at different price points, from no cost and quite restricted up to enterprise level that costs more but comes with all the bells and whistles. I dove in with a free account to facilitate testing of my bot.
Once the Slack account was up and running along with the associated team (which I couldn’t resist calling “Chatty McChatface”), I was ready to deploy my Hubot (Io).
In Slack, you simply navigate to the Apps directory and search for Hubot.
There follows a handful of simple configuration steps which include generating an access token. This is important as that token is used on the server hosting Hubot to enable the connection with Slack, in much the same way as the access and secret keys enable access with AWS. (The next post will deal with environment variables like this one).
With Hubot configured in Slack (and connected on the server) it’s possible to use a chat room to interact with Hubot. Initially, the bot will have a direct or private room for 1:1 chat, like any team member. Here, simple tests can be carried out in private to ensure all is working as it should.
There’s far more value in having Hubot out in the open in one of the team rooms and enabling that is as simple as inviting Hubot to join the room, just like you would for a human team member, through the “/invite @[BOTNAME]” command.
Now that Hubot was in place and working, AWS functionality could be tested. The hubot-aws script features a lot of commands, but a simple listing (ls) command of one of the AWS services is enough to ensure connectivity. Like any good bot, Hubot will list all the commands he supports through the “help” command.
So there you have it, a working Hubot implementation, connected to and interacting with AWS, presented through Slack.
Up next, how to use Systemd to automate the running of Hubot.