1

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?

jig
  • 73
  • 2
  • 8
  • The build is successfully started by the hook? What happens if you let Jenkins poll instead? – Daniel Beck May 14 '13 at 21:22
  • yes it is working with this hook, but i jenkins doesnt know who started the build. i only know which account binded to svn did the commit into the repo. correct me if i am wrong, but poll/post-commit is just a different way to start the build, so this would not chance anything? – jig May 15 '13 at 12:24
  • just noticed this line in my console output after a build: "Failed to send e-mail to test because no e-mail address is known, and no default e-mail domain is configured An attempt to send an e-mail to empty list of recipients, ignored."
    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

0 Answers0