Thursday 4 August 2016

Cake.HipChat AddIn - my first contribution to the community

So I've been using the wonderful Cake build system for a little while now and think it is a great tool. One thing I noticed missing in the list of add-ins though was one for HipChat.

So I made one myself.

This is my first entry into creating something open source, and while it is only a few lines of fairly boilerplate code, I found it a really fun experience. There are so many freely available tools that make spinning up a fully fleshed out CI experience a breeze - I created the add-in itself, build script, continuous integration (Appveyor) and deployment (MyGet + NuGet.org) in around 2 hours (with interruptions). This didn't involve me installing any servers, creating any virtual machines, or even having to pay a single penny or cent on anything. I knew all this stuff was there and available, but it is only when you start playing with it that you really see the true power of it all.

The source is hosted in GitHub https://github.com/scene316/Cake.HipChat and is currently in a very basic state, yet it works pretty well. It used an existing NuGet package, HipChat.Net, to interact with the API, the downside being it appears to only work with v1 of the API, so that will be something to work on.

As would be expected, I created a build script for this project using Cake, and eventually included my own Cake.HipChat AddIn within that build script to send a message to a HipChat room. That dog food tasted good. I used the Cake.Slack and Cake.Twitter add-ins as examples and they really helped  - there is also good documentation but just seeing a project with all the associated bits was helpful.

Once the build script was working locally I set up the Appveyor build - this was really easy as there is rich integration between Appveyor and GitHub - everything just works. All I had to do was set a few environment variables and identify my build script PowerShell bootstrapper. Simple as that and I had a fully functioning CI system in minutes. Builds are quick with a very short queuing time - given this is all for free for open source projects this is incredible.

When the build finishes, pre-release versions are uploaded to a feed I've set up on MyGet. The final step, which I perform manually now, is to then push a proper release version to MyGet and NuGet.org when I've got something to release for real - https://www.nuget.org/packages/Cake.HipChat/.

27 downloads today from NuGet.org - a couple will be my build process, but I'm happy with that!





0 comments :

Post a Comment