Sunday, December 22, 2013

Hudson 3 Essentials Book

I recently finished my first book, "Hudson 3 Essentials" for Packt Publishing. The book description is available here.

The purpose of this post is to describe the book from my perspective.

The book is written as a quick and hands on introduction to Hudson 3 for readers who are new to Hudson or who have very little experience working with Hudson. After finishing the book, readers should understand the basics of Hudson and have the foundation to extend their knowledge with online resources and/or experimentation.

Chapter 1 is a brief introduction to Hudson, Continuous Integration and how using Hudson can help software development teams. This will hopefully give the reader a reason to continue on with the rest of the book.

Chapter 2 shows how to easily run and configure Hudson using common open source application servers as well as in stand-alone mode. I give detailed installation instructions for tomcat, glassfish and JBoss AS. I would have liked to include jetty but I haven't worked with it enough and was running short on time. The reader should have a working Hudson 3 instance by the end of this chapter.

Chapter 3 covers the basics of Hudson usage and configuration including security options. This isn't a very exciting chapter, but necessary. There are a lot of nice options for integrating Hudson with existing infrastructure (LDAP or application server security) or using Hudson itself.

Chapter 4 is about Hudson plugins. We explain the different categories of Hudson plugins and install a couple of the more common plugins. We then introduce writing your own plugin. Writing Hudson plugins could probably take a couple of chapters on their own but this is hopefully enough to get the reader started. It was a pleasant surprise how easy it was to get started with a new plugin. The sample plugin that was created in this chapter is on my github page.

Chapter 5 is where we start creating Hudson jobs. I wasn't too sure how to handle this chapter, then I realized how easy it would be to take an existing open source project and build it in Hudson. I wanted to demo as many technologies as possible (especially projects I like) and create a sample job for each of them. So we create three jobs to demonstrate three technologies:

  1. maven is used to build the Spring Petclinic application
  2. gradle is used to build the gradle project (cute!)
  3. grails is used to build the spring-security-core grails plugin

Finally, we show how you can use groovy to perform tasks that aren't supported by plugins. It's amazing how easy and powerful combining groovy and Hudson in this way is.

Chapter 6 is about how we can use Hudson to run tests on the projects and create reports based on the test results. Hudson leans very heavily on the tests run by the build too (ant, maven or gradle) that is being used and then collecting those results into a central location. We demonstrate creating javadoc from existing code, running and publishing JUnit tests, and running and publishing PMD, FindBugs and Checkstyle tasks. I think this could be very useful for a manager to be able to easily keep tabs on project status without status meetings. A testing team could also have a baseline of tests that could be automated and insist that no build be promoted to the testing environment that didn't pass these automated tests. The sample project that was created for this chapter available on my githup page.

Chapter 7 covers the important topic of backing up your Hudson configuration and also upgrading. I had a bit of fun describing the team feature that was added in Hudson 3.1 by using the Avengers and X-Men as example teams.

That's it. I hope people find the book useful.

1 comment:

  1. Well, great. This certainly seems like a good starting point for learning Hudson... Now I just have to motivate myself to actually learn Hudson. That's always the hard part with me when it comes to learning new languages.

    - Fred