Quantcast
Channel: TechSmith Blogs » DevCorner
Viewing all articles
Browse latest Browse all 11

Dev Corner – Installing Hubot on Heroku

$
0
0

1021-hubot.jpg

Here at TechSmith, lots of our teams like to use Campfire to collaborate. We’ve built a few homegrown bots for things like announcing check ins and daily Dilbert comics, but we never took it to the level that GitHub did. When they released Hubot, we jumped at the chance to start using it ourselves.

The easiest way to get up and running with Hubot is with Heroku, the cloud application platform. First create a Heroku account. Then you’ll need to verify the account (which means entering a credit card). Heroku requires users to be verified to add redis to go to your application stack.

First thing you’re going to need to do is get a few things installed.

  • Ruby
  • Ruby Gems
  • Heroku Gem
  • Git

I set it up using a Mac but these steps should work fine as long as your platform supports Ruby and Git.

First make sure you have the heroku gam installed.

sudo gem install heroku

Download Hubot by clicking “I would like to obtain my own Hubot”.

Extract your download and change to that folder in the terminal.

Setup Git

Create a git repository in that folder by typing

git init
git add .
git commit -m "Initial commit"

Setup Heroku

Now you need to create your Heroku stack.

heroku create --stack cedar

Now push your files to Heroku

git push heroku master

If you get any issues with public keys, check out these two links, which may be able to help.

Next you need to set up the worker

heroku ps:scale app=1

heroku add ons:add redistogo:nano
If you haven’t verified your account with Heroku this will fail.

Hubot is almost ready to go.

Configure Hubot to work with your Campfire room

First you’ll need a user that Hubot will use to talk in the chat room. You can create a new one or use one that already exists. Once you pick a user, you’ll need their auth info. This can be found by clicking the “My Info” link in the upper right corner.

  1. 1019-myInfoCampfire.png
    1020-AuthToken.png
    heroku config:add HUBOT_CAMPFIRE_TOKEN="YOUR_AUTH_TOKEN"

    Replace YOUR_AUTH_TOKEN with the Hubot API token you just found.

  2. heroku config:add HUBOT_CAMPFIRE_ROOMS="999,888"

    Replace the 999 and 888 with your Campfire rooms. To figure out your room number, click on the room you want Hubot to monitor and look for the number at the end of the URL.

  3. heroku config:add HUBOT_CAMPFIRE_ACCOUNT="YOUR_ACCOUNT"

    Replace YOUR_ACCOUNT with your Campire domain. (yourdomain.campfirenow.com)

Now you have your very own Hubot. Hubot comes with a few scripts installed that will do things like search Twitter and Google image search. Read the documentation on how to add your own scripts here.

Pro Tip: If you want to change Hubot’s name, open the file in your hubot directory called Procfile. Change “Hubot” to whatever you want to call your Hubot. Save the file, recommit and repush to Heroku.

976-RandallDevCorner.jpg

Randall Brown started at TechSmith in 2009 after graduating from the University of Michigan with a degree in Computer Science. He is a member of the Coach’s Eye team where he is working on the ultimate coaching tool.

The post Dev Corner – Installing Hubot on Heroku appeared first on TechSmith Blogs.


Viewing all articles
Browse latest Browse all 11

Trending Articles