Hubot is an awesome and extendable bot created by the cool folks at GitHub. While Hubot was originally created for Campfire, there's now adapters for different platforms including IRC, so it works nicely with Grove. The easiest way to deploy Hubot for Grove is to use Heroku for hosting.
To get started you'll need to sign up a new user to your organization. Register an account with the username you want your Hubot to be called. I went with simply grovebot. Here's how you can deploy the bot manually but if you want you can use Tom Bell's Hubot Factory which will do most of the heavy lifting for you.
Setup
To install Hubot, you'll first need to have CoffeeScript and npm installed. The web is full of instructions for installing both so we won't cover them here. Start the installation by cloning Hubot and creating a new instance.
git clone https://github.com/github/hubot.git
cd hubot
npm install
# Create new Hubot and switch directories
bin/hubot --create ../grovebot
cd ../grovebot
# Setup git repo
git init .
git add .
git commit -m "initial commit"
Now you need to add hubot-irc in the dependencies by editing the package.json file.
"dependencies": {
"hubot-irc": ">= 0.0.1",
"hubot": ">= 2.0.0",
...
}
Next modify the Procfile to match the following (remember to replace grovebot
with your bot's name).
app: bin/hubot -a irc -n grovebot
Save both files and commit changes. Now it's time to deploy the app to Heroku (again, change grovebot
to match your bot's name).
# Create Heroku app
heroku create grovebot --stack cedar
git push heroku master
# Some hubot extensions require Redis (RedisToGo needs to be active)
heroku addons:add redistogo:nano
Next configure your Hubot to work with Grove's IRC interface. Use your organization's and bot's information.
heroku config:add HUBOT_IRC_NICK="grovebot"
heroku config:add HUBOT_IRC_ROOMS="#channel-name"
heroku config:add HUBOT_IRC_SERVER="organization-name.irc.grove.io"
heroku config:add HUBOT_IRC_PASSWORD="organization-name"
heroku config:add HUBOT_IRC_NICKSERV_PASSWORD="password for the bot goes here"
# To use SSL but you can leave these out
heroku config:add HUBOT_IRC_PORT=6697
heroku config:add HUBOT_IRC_USESSL="true"
Once you're done, fire up your Hubot.
heroku ps:scale app=1
Now you should see the newly created Hubot join your chat rooms. Your Hubot should reply to you if you call it by name.
grovebot help
If it doesn't reply, something is wrong and you can get more information with commands.
heroku logs
heroku ps
Resources
To read more about deploying Hubot, check out these guides:
Deploying Hubot to Heroku like a boss - martinciu's dev blog
Deploying Hubot onto Heroku - Hubot Wiki
Adapter: IRC - Hubot Wiki
Big thanks to Tom Bell who has contributed to Hubot by creating Hubot Factory and maintaining its Wiki. He also helped with this guide.
Image credit: GitHub