Hudson CI testing for grails from git

After running continuous integration with continuum for a long while (which works great for maven projects) I decided to take a look at Hudson. It can also do maven - but seems to have a larger range of plugins available. Of interest to me was grails.

Installation

This was extremely simple - I just grabbed the hudson.war file from the hudson site and deployed it in a running glassfish.

LDAP configuration

This was a bit more complex. Under Manage Hudson > Configure System

Hudson LDAP config
Click to view full size

Note the User/Group names - ROLE_ADMIN and ROLE_HUDSON. For this to work you need groupOfUniqueNames entries directly under the group search base (here ou=groups,dc=chrissearle,dc=net) with the names cn=admin and cn=hudson. Hudson will match this by removing ROLE_ and lowercasing the rolename. This was unclear in the hudson docs I was reading but google came to the rescue.

Plugins

To be able to test grails projects from git I installed the grails and git plugins (Manage Hudson > Manage Plugins > Available). Check them off (and any others you want) and then install them.

Each plugin will add a config section under Manage Hudson > Configure System.

For git:

Since git is in the path this is OK - otherwise set the full path.

For grails:

Here only grails 1.0.4 is configured - but you can add several different versions.

Project

Now lets add a grails project.

Choose New Job from the main menu.

Add a name and choose free-style.

To configure the project - choose git from the SCM configuration section - my projects have the ability to be cloned over http - so just add the clone URL as the git repository url. Set a branch if you're not testing master.

For build triggers - I chose to poll the SCM with the following schedule */5 * * * *

For build choose "Add build step" and choose Build with Grails. You'll need to pick which grails installation from the dropdown (these were configured above) and also target.

I normally add two grails build steps - one for target test, one for target war - so that if it fails then the notification tells me which step.

Finally set whichever notification options you want. Git specific is the ability to tag the original repository with the test.

Other plugins

For me the other plugins that are useful are JIRA (if the last commit message contains a JIRA tag then it will comment in the JIRA issue when the test passes), and email/jabber/irc/twitter notifications.

Comments

Anonymous's picture

Hudson, Grails, GIT and Tomcat

I just saw your page was similar to a topic that I recently covered on my blog. We are concentrating on different aspects of the installation, so you, or your readers might also be interested in taking a look at my article.

Installing a Continuous Integration Server

Post new comment

The content of this field is kept private and will not be shown publicly.
  • You can use Markdown syntax to format and style the text. Also see Markdown Extra for tables, footnotes, and more.
  • Allowed HTML tags: <a> <p> <span> <div> <h1> <h2> <h3> <h4> <h5> <h6> <img> <map> <area> <hr> <br> <br /> <ul> <ol> <li> <dl> <dt> <dd> <table> <tr> <td> <em> <b> <u> <i> <strong> <font> <del> <ins> <sub> <sup> <quote> <blockquote> <pre> <address> <code> <cite> <embed> <object> <strike> <caption>
  • Lines and paragraphs break automatically.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Insert Flickr images: [flickr-photo:id=230452326,size=s] or [flickr-photoset:id=72157594262419167,size=m].
  • Replace [debbug:xxxxx] with a link to the relevant debian bug. xxxxxx can be a bug id, package, or any of several others - see http://www.debian.org/Bugs/ and scroll down to the list of URL forms for other examples.
  • You may link to Gallery2 items on this site using a special syntax.
  • Insert Google Map macro.
  • Images can be added to this post.
  • You can link nodes to other nodes using the following syntax:
    [node:node_id,title="val2"]

More information about formatting options