Wednesday, October 27, 2010

Continuous integration server with Hudson for Java, .NET and beyond.


Continuous Integration and Automated Build Environment...

We all know it's super awesome and we need to have this practice. The point of this post is simple. How to get hudson (very simple continuous integration server) up and running to checkout (from svn, git, etc) and build your java (maven, ant) or .net (nant) projects at light speed.

First download the hudson.war from http://hudson-ci.org/. You will need jre 1.5+ and ........that's it! No DB no configuration no nothing!!!! Hudson stores your setup under ~/.hudson in xml files but for all practical intents and purposes you don't need to worry about it.

start the embedded jetty by typing the following in your terminal:

java -jar hudson.war

This will start jetty at http://localhost:8080

Go to that URL in your browser. You should see something like this



Now if your using git you need to install the git plugin. Go to the nav bar on the left and then to manage hudson->manage plugins. Here you can install the git plugin (as well as the nant plugin if your working in .net).

Lastly, you create a new job. When you create a new job you can go to configure and fill out the easy to follow GUI form.

That's it!

Thursday, October 21, 2010

Goodbye MS Visual Studio & .NET, Hello Mono Stack + Lucid Lynx!

I'm originally from the MS world. Don't fault me it was the time that I grew up. My generation had pretty much grown up eating up MS products without any knowledge of anything else. So naturally while doing a CS undergrad I learned classic ASP and out of school started with .NET 1.1.

The last two or so years I've had the pleasure of working at a company that is solely open source. At first I hated it. Everything seemed soooo much harder. You had to configure this and configure that and I absolutely hated the linux command terminal. Little did I know it was my ignorance that made me hateful. Not before long, I fell in love with the terminal. Then I fell in love with Java and JEE. Open source simply fits the personalities of true developers better. I would of told present day me off 2 years ago, but it's true. MS creates inferior developers.

Anyway, recently I got a project that was .NET. I had heard of Mono before but I actually got a chance to work with it. Let me tell you that it's awesome!!! Sure it doesn't have all the bloat that VS has but that bloat is unnecessary anyway for most things I work on. It's faster than VS2008. NUnit hooks in beatifully, unlike the MS Test project that is super bloated and slow. It has all types of engineering goodies like LOC, Cyclomatic Complexity, etc.

Anyway for the full stack you gotta get:

1. Mono - Runtime
2. MonoDevelop - IDE
3. MonoDevelop-Nunit - NUnit integration for IDE
4. Nunit - Command line NUnit
5. NAnt - Build tool
6. XSP2 - Mini Web/App server for asp.net

If your on Ubuntu 10.04 follow these steps:

1. Add deb
http://badgerports.org lucid main
to
/etc/apt/sources.list
2. Run following commands

gpg --keyserver http://badgerports.org/directhex.ppa.asc --recv-keys 0E1FAD0C
gpg --export --armor 0E1FAD0C | sudo apt-key add -
sudo aptitude update
sudo aptitude install monodevelop
sudo aptitude install monodevelop-nunit
sudo aptitude install nunit
sudo aptitude install nant
sudo aptitude install mono-xsp2

That's it. I guarantee it'll be installed before you get through the first 5-10 minutes of VS2008 if you have good bandwidth.