Java Reference
In-Depth Information
Maintaining Your Code with Continuous Integration
Problem
You want to be sure that your entire code base compiles and passes its tests periodically.
Solution
Use a Continuous Integration server such as Jenkins/Hudson.
Discussion
If you haven't previously used continuous integration, you are going to wonder how you got
along without it. CI is simply the practice of having all developers on a project periodically
integrate their changes into a single master copy of the project's “source.” This might be a
few times a day, or every few days, but should not be more than that, else the integration will
likely run into larger hurdles where multiple developers have modified the same file.
But it's not just big projects that benefit from CI. Even on a one-person project, it's great to
have a single button you can click that will check out the latest version of everything, com-
pile it, link or package it, run all the automated tests, and give a red or green pass/fail indicat-
or.
And it's not just code-based projects that benefit from CI. If you have a number of small
websites, putting them all under CI control is one of several important steps toward develop-
ing an automated, “dev-ops” culture around website deployment and management.
If you are new to the idea of CI, I can do no better than to plead with you to read Martin
Fowler's insightful (as ever) paper on the topic . One of the key points is to automate both the
management of the code and all the other artifacts needed to build your project, and to auto-
mate the actual process of building it, possibly using one of the build tools discussed earlier
in this chapter. [ 8 ]
There are many CI servers, both free and commercial. In the open source world, CruiseCon-
trol and Jenkins/Hudson are among the best known. Jenkins / Hudson began as Hudson,
largely written by Kohsuke Kawaguchi, while working for Sun Microsystems. Unsurprising,
then, that he wrote it in Java. Not too surprising, either, that when Oracle took over Sun,
there were some cultural clashes over this project, like many other open source projects, [ 9 ]
with the key players (includine Kohsuke) packing up and moving on, creating a new “fork”
 
 
Search WWH ::




Custom Search