Hi everyone,
I'm recently working on this automation solution for my dev team using SVN as version control, to run builds and tests automatically when a commit occurs.
But each time when I commit my post-commit hook script fails me :/
post-commit hook failed (exit code 127) with output:
/url/to/our/svnServer/hooks/post-commit: 67: --post-data: not found (which is odd : the --post-data line is not at line 67 which is the last line of the file)
I'm not able to find the exact same problem on the web so no solution found... My script looks like this (the same script from the official doc):
REPOS="$1"
REV="$2"
#path to svnlook
UUID=`svnlook uuid $REPOS`
#notifying jenkins for repository change
/usr/bin/wget \
--header `wget -q --output-document - \
--post-data "`svnlook changed --revision $REV $REPOS`" \
--timeout=2 \
http://my_jenkins_url:/subversion/${UUID}/notifyCommit?rev=$REV
Jenkins is on my machine, SVN server on another machine. So I'm using Putty to access to all the hooks on that machine.
In the global security section I have "Jenkins users database" checked, in autorisations I use matrix based security and I already gave anonymous users Read permission for jobs; As for my job config I already checked the SCM polling option and have a valid CRON (which works perfectly), also I checked "trigger builds remotely" and provided my own token (works fine too).
Do you think it might have something to do with the credentials that I set for Jenkins job to link with my repo on SVN? I haven't quite understood how this affects the commit: should I add something like --username and --userpassword into my post-commit hook accordingly to my credentials settings? Or is this because SVN is not on my machine and I'm using a SSH client to access hooks there yet I haven't set SSH server option in Jenkins?
What might be the problem in your opinion? Does someone know how to use post-commit hook? Thank you so much if someone can provide some advice and insights :)