After writing about “Running your TeamCity builds from PowerShell for any Git branch” I’d like to talk about another integration which is using Github Hubot so that the build could be started directly form a chat room.
The main idea of this is to have our daily tools right at our disposal where we spend a good part of our days, chat rooms.
First we had to install Github Hubot and we have chosen to use Heroku which offer free hosting for one of their web dyno. They even offer what they call Hubot Factory which is a way to allow people to easily and quickly deploy new instances of Hubot to Heroku. In fact we went with a manual installation described on this page “Hubot for HipChat on Heroku”.
The idea is still the same we need to run TeamCity builds by “Accessing the Server by HTTP”.
This time we want to have Hubot calling the TeamCity server so we need to add a new CoffeeScript to the scripts of Hubot which will launch the HTTP request needed.
Our script is heavily inspired from the TeamCity.coffee script, and here is a first version:
# Starts a build on TeamCity.
By the way I started to learn CoffeeScript so this is more hacking then something really productive.
And here is the result in our HipChat room asking hubot to start a build with the command:
hubot start build bt21
I will talk in another post about the last part which shows the status of the build in the chat room.