views:

165

answers:

2

Problem

I have a hudson build server set up on a windows server 2008. We want to be able to commit to a repository and after the commit succeeds we want visual svn server to send a message or a trigger to the hudson build server to let it know it needs to execute a build. We want it to build only when someone does a commit so we don't want to poll svn constantly because its not necessary.

Question

Is there a plugin for visual svn that can automatically send a message to hudson or is there a better way of doing this without using wget? I've tried using wget on the hudson build url in the post commit hook of visual svn server but I realized that the post commit hooks can only be set for the entire repository and not individual projects in visual svn server, so if we made a small change to a different project in the repository its going to tell hudson it needs to build even though no changes have occurred in the project that is linked with hudosn...

+2  A: 

How about let Hudson figure that one out. Hudson can poll the repository (only the URL of your project) to find out if there are changes and build only if changes are detected.

Peter Schuetze
I know what would work but my team doesn't want hudson to keep polling every so many minutes.
MikeU
A: 

I agree with @Peter_Schuetze, let Hudson figure this out. It's not worth optimizing this unless you really see a problem.

You can use the post-commit hook to push Hudson and "Hudson will then check [the changes] against all the jobs that have a polling configured, and schedule the builds accordingly."

the post commit hooks can only be set for the entire repository and not individual projects

True. If you're really concerned though, in the post-commit hook, you could examine the changed directories before pinging Hudson, something like:

changes=`svnlook dirs-changed -r $REV $REPO`
case $changes in
   my_project/*)
     # ping Hudson
     ;;
esac

To me, it sounds like too much work to keep the post-commit hook up to date.

Dave Bacher