i am trying to setup jenkins and svn for my project. jenkins and svn is running already. currently i have a post-commit hook which starts a build everytime a new commit comes in.
my jenkins is secured with jenkins own user directory
and enabled registrations. i have also activated matrix-based security
.
I would like to have the following scenario:
Whenever a developer commits, the post-commit
script is called and the build+tests starts. Whenever the build fails the developer who did the commit shall receive an email with informations why the commit failed. Also the commit should be reverted in my repo. For the reverting thingy i have already installed revert plugin
and activated it for my project. But it seems like it is not working, because nothing happened to my repo after i did a test-commit which lead the build to fail. Maybe i miss another jenkins+svn configuration? I know that revertig commits is not best practice, but i would like to have always a valid build in my repo for test/demo.
My post-commot
file looks like this:
#!/bin/bash
REPOS="$1"
REV="$2"
UUID=`svnlook uuid $REPOS`
/usr/bin/wget \
--http-user="user" \
--http-passwd="psswd" \
--header "Content-Type:text/plain;charset=UTF-8" \
--post-data "`svnlook changed --revision $REV $REPOS`" \
--output-document "-" \
--timeout=2 \
http://ip/jenkins/subversion/${UUID}/notifyCommit?rev=$REV
This script is basically working, but as you can see the user+password is hardcoded. But i currently do not know how else i could provide the authentifaction informations to jenkins. Maybe i have logical problem, since every developer needs not only a fresh checkout + an account from my repo, but also an account on jenkins to get the whole idea working?
test is a user from my repo and i am using dav_svn with a authuserfile. i will try to add an email to a user in here. – jig May 15 '13 at 12:39