This week I finally got the time to check out Hubot. Which really is a cool bot for your IRC/Campfire-Channel.
As I dislike solutions like “just extract this tarball and run …” for production deployment, I needed a way to deploy and configure this with puppet. The solution should also be very easy, so we can create a jenkins task to build the package.
I came out with a solution where you just need to run two commands to create a new package from upstream:
My solution was to use fpm to create a debian package from a folder which contained all the stuff to run Hubot.
As there is a huge repository of Hubot-scripts and I also wanted some plugins out of it, I also needed a configuration file to define which scripts I wanted to have packaged into.
To automate the process of downloading
Hubot and the needed scripts,
afterwards installing the
npm-modules and packing it with fpm,
I decided to use
There is a configfile,
Rakefile contains all the rake-tasks which are used to build
prepare-task takes one argument which should be the version (e.g
It downloads the tarball of this version and extracts it in a subfolder.
Then it downloads all the specified scripts and puts them into the
correct folder of Hubot.
Afterwards it installs the
npm-modules to another subfolder of
The most interesting part are the
This command creates a debian package (
-t deb) from a directory
-s dir) and throws all the stuff of the given directory
It uses the version we gave the
and adds a
preinst and a
-d nodejs we set a dependency on
We need to change the current workingdir, otherwhise fpm would deploy
the stuff in
The second fpm command packages the init script and the example config
file from the
postinst scripts just add a
user and set the rights on
/opt/hubot as fpm
does not support right management for debian packages,
I tried several times to get all these stuff working. For an easier cleanup between the tries, I added another task:
Now we just need to modify the
config.yml, push the changes and
call Hubot in our IRC-Channel to trigger the jenkins build: