Install the Hudson build server on Ubuntu 10.10 Server
First off, after trying out most of the free build servers on the market, I’ve found that Hudson ( http://www.hudson-ci.org/ ) is the best for me. It’s by far the easiest to configure and it runs pretty smoothly. The plugin ecosystem is vibrant and there are constantly new and interesting plugins. I’ve used it for java, grails and even msbuild projects with success.
I’m learning about headless linux servers and hosting on them, so I’m using this an opportunity to document the sometimes tricky install procedures. I’m using Ubuntu 10.10 Server in a 32-bit edition. I must admit that I’m impressed by the performance of the headless linux server. It’s running in VMWare Player 3 with 512mb ram, on a USB drive, on my underpowered Lenovo T500 laptop… and it feels snappy!
I’ll assume that you’ve already done the steps for installing grails. If not, you at least need to do a succesful:
sudo aptitude install sun-java6-jdk
I got some of this installation info from http://hudson-ci.org/debian/. First we need to install a prerequisite:
sudo aptitude install daemon
Then we need to fetch a key (and install it) and a deb package (and install it). After that we update the apt repo list and do a “normal” install
wget -O /tmp/key http://hudson-ci.org/debian/hudson-ci.org.key
sudo apt-key add /tmp/key
wget -O /tmp/hudson.deb http://hudson-ci.org/latest/debian/hudson.deb
sudo dpkg --install /tmp/hudson.deb
sudo apt-get update
sudo apt-get install hudson
Once the package is installed, normal updating should work. Check that the install is okay by visiting:
http://<hostname>:8080
Running hudson on port 8080 is not cool, since so many other servers want to run there (Tomcat for instance). So let’s change the port number:
First, stop the hudson server:
sudo /etc/init.d/hudson stop
To change change port number for hudson to 9090, run this line:
sudo perl -pi -e 's/HTTP_PORT=(.*)\n/HTTP_PORT=9090\n/g' /etc/default/hudson
It does a search and replace in the /etc/default/hudson and replaces the port number. Call this to verify the new port number:
cat /etc/default/hudson |grep HTTP_PORT=
Then you can start Hudson again:
sudo /etc/init.d/hudson start
In case you need to debug something or if you’re a log geek you can find the hudson log is in /var/log/hudson/hudson.log. You may want to run
tail -f /var/log/hudson/hudson.log
to keep viewing it
PS: Thanks to Theis Borg for helping me with the linux scripting!
[...] a comment » I’ve learned how to set up setup grails and how to install hudson on Ubuntu 10.10 Server. Now I want to use hudson to build my grails [...]
Building a grails project in hudson « makeitfaster
December 14, 2010 at 16:40
Thanks for this post! I had trouble finding a decent Hudson installation tutorial for Maverick so this saves a lot!
Ygam Retuta
February 18, 2011 at 03:07
I’m glad you liked it
Sebastian Vilstrup
February 18, 2011 at 08:49
This worked well. Thanks for the information
Jeff Ancel
March 26, 2011 at 18:58
wget -O /tmp/key http://hudson-ci.org/debian/hudson-ci.org.key
when I do this i’m getting
–2011-07-26 12:39:58– http://hudson-ci.org/debian/hudson-ci.org.key
Resolving hudson-ci.org… 192.18.49.133
Connecting to hudson-ci.org|192.18.49.133|:80… connected.
HTTP request sent, awaiting response… 404 Not Found
2011-07-26 12:39:58 ERROR 404: Not Found.
did i miss something?
Geoff
July 26, 2011 at 17:46
I’m afraid the article is out of date
Hudson is no longer Hudson, it is now called Jenkins… due to some legal/license battle between the developers and Oracle.
http://jenkins-ci.org/ is the place to be. They have continue the great CI server, and they have a good infrastructure and some good installation guides too.
Currently the link for the ubuntu/debian install is here: http://pkg.jenkins-ci.org/debian/
Sebastian Vilstrup
August 17, 2011 at 16:55