Meera has posted 70 posts at DZone. You can read more from them at their website. View Full User Profile

Hudson's so Groovy

03.24.2008
| 13545 views |
  • submit to reddit

Having used Cruise Control for almost 4 years, when I started looking at Hudson last week, I was impressed seeing how easy it was to configure and get it up and running in just a few minutes. It also has several plugins available, and if you don't find one you can quickly write one as well.

Andrew Glover, in the TestEarly Blog, shows us how to use Groovy with Hudson. Hudson has a Groovy plug-in which can execute Groovy Scripts.

To quote from the blog "as a part of a CI project setup, another dependent project’s directories were becoming read-only due to an SCM feature. Consequently, a child project couldn’t write to the filesystem.

This problem was easily solved using Groovy (plus a little Ant)– a triggered build executes a small Groovy script that uses Ant’s chmod task to make target directories read-write enabled. As you can see, the fix requires 2 lines of code (which could, arguably, be reduced to one)"

def ant = new AntBuilder()
ant.chmod(dir:"./ci09_i/ui/rep2/reports/", perm:"ugo+rw", includes:"**/*.*")

You can read the complete story at TestEarly.com

Isn't that cool? However, I am not sure if there is a way to specify Hudson to run the Groovy Script first before executing any build script or vice versa, any ideas?

Here are some useful links for additional reading:

1. TestEarly.com

2. thediscoblog.com

 

Published at DZone with permission of its author, Meera Subbarao.

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)