Jenkins CI uses wrong svn revision for build

Daniel picture Daniel · May 3, 2011 · Viewed 9.1k times · Source

currently I am working with Jenkins CI Server and I want to trigger a job/build via svn post commit hook. So far it works as expected, but the build uses the previous svn revision.

For example: I check in my files and the client shows me revision 90, the build starts, but it uses 89.

The post-commit hook looks like that:

UUID=`svnlook uuid $REPOS`
/usr/bin/wget \
     --header "Content-Type:text/plain;charset=UTF-8" \
     --post-data "`svnlook changed --revision $REV $REPOS`" \
     --output-document "-" \
     --timeout=2 \
     http://ci-jenkins/job/Job1/build?rev=$REV 1>&2

The Check-out Strategy in Jenkins in configured "Always check out a fresh copy". What is wrong? I am still starting with that and have much to learn. So please keep that in mind for answering me. :-)

Answer

András Kerekes picture András Kerekes · May 17, 2013

Ran into the same issue and found this:

Basically you need to append @HEAD at the end of the SVN url, e.g.:

http://svn.yourserver.com/svn/project/trunk@HEAD