How to trigger a Hudson build on a Subversion commit

This article describes how to set up Subversion on Linux/OSX (where wget is available) to trigger a Hudson build on each commit.

There is a nice post that tells how to tweak Hudson to run a build triggered by a post-commit hook on your subversion server.

There is a problem, that arises if we have a Hudson deployment that is password-protected. Then wget just returns Unauthorized , because he is first diverted to the login page where he has to log in.

To get around this problem we need to create a Hudson USER identified by a PASSWORD . We may want to give this user limited permissions, e.g. build only.

Then the post-commit hook would look like the following (merge it into one line, no extra spaces):

  wget -b http://HUDSON_URL/job/JOB_NAME/j_acegi_security_check?j_username=
  my_automated_build > /dev/null

The hook also contains the default code of sending an email:

 /usr/share/subversion/hook-scripts/ \
  "$REPOS" "$REV"

You may want to comment it out.