Home > Projects > Setting up Hudson CI on Ubuntu

Setting up Hudson CI on Ubuntu

Summary

“Continuous Integration” helps improve code quality by testing the code after every commit to the source code repository. I’m interested in finding out how easy it is to setup a CI server.

For this experiment, I’ll install it on my localbox, running Ubuntu 10.04 (32-bit). Eventually, I’ll want to install it on a Centos5 64-bit server and also hook it up to run tests on a Django project (in later articles, perhaps).

I’m choosing to investigate Hudson CI, because it’s open source and also because I know some organizations use it already.

Personal side-note

I’d prefer a python-only solution, but since I’m not actually developing a CI server myself, I’m OK to use an open-source Java-based product.

Why not Jenkins?

I only heard about Jenkins today, via an article on Hudson’s website. There seems to have been some sort of rift among the developers, which led to the Jenkins fork from Hudson. (Viva open source!) But, for now, we’ll stick with Hudson because that’s what the other organization is using, and I don’t want to deal with potential differences between the forks right now. (Please, no comments about this, while I sort it out for myself.)

Installing Hudson, take 1

The Hudson documents have an article about Installing Hudson on Ubuntu, so let’s try it.

Everything seems to be going fine, but this slow connection at the local cafe’ is making the 60MB download take a while…

OK, I accepted all the defaults, then tried to access the site. BAM!

Status Code: 400
Exception: URI must start with a slash: [{“id”:
Stacktrace:
(none)

Well, that didn’t work.

Installing Hudson, take 2

That page linked to this one with manual instructions. Yep, that’s another 60MB download. Oh, well.

Yay! It worked! (But I’m not sure whether the second install did it, or just fixed it. If you try it, let me know how it goes.)

Setup my first Hudson Job

Well, maybe I will test that Django stuff now. I’ll try to do a clean check-out and test of the django-dogwood project. Here are the options I chose to create this job in Hudson’s UI:

  • Build a free-style software project
  • Discard old builds (after 1 day, keeping only 1 build)
  • Source code management: Subversion (Yikes! No Mercurial support? maybe there’s plugin…)
  • Don’t use “svn update”.
  • Build triggers – Uh…what do I do here? The help text is somewhat informative, but they link to non-existent pages! I think I’d like to build continuously, but how…?
  • Post-build actions: email me when it’s broken.

I saved with those options. It turns out that I can kick off the job manually, which I did. It reported that it got “Revision 73”, which is the latest revision. But it didn’t do anything…doh! I forgot to tell it to run the Django tests. Maybe I will save this for another post.

Conclusion

So far, so good. I’m fairly impressed with Hudson’s easy installation on Ubuntu (despite having to do it twice). It’s a decent UI, and it seemed to attempt my checkout-and-test job…as much as it could with the limited information I gave it.

Thumbs up, Hudson!

  1. guitarmanvt
    March 4, 2011 at 9:08 am

    I tried it again on another Ubuntu box. The instructions from “Take 1” worked just fine on Ubuntu 10.04 (lucid), accepting the package maintainer’s replacement config file(s).

  2. guitarmanvt
    March 4, 2011 at 9:17 am

    Following the same instructions, I just set up another free-style project with the django-cedar source code (http://code.google.com/p/django-cedar/). Worked fine. I’ll continue on to Django testing with XML output, per https://opensourcemissions.wordpress.com/2011/02/28/testing-django-with-hudson-ci/.

  1. February 28, 2011 at 4:14 pm

Leave a comment