3
votes

I would need to checkout the latest SVN tag to my Jenkins build job workspace. With tag I mean the copied folder, often used to create milestones.

I read from some stackoverflow question that one could get the latest e.g. with

"svn ls .../path/to/repo/tags | tail -n 1"

, but I don't think this can be given to Jenkins SCM field. I believe Jenkins requires the exact location in SVN. Any ideas? I would believe this is actually quite a common requirement in large projects....

1

1 Answers

3
votes

Suggested answer is almost correct on the assumption that:

  • Incremental alpha-numeric permanent naming scheme used
  • BASE path somehow added to result of pipe (ls output relative path to tags/)

If the above conditions are not fulfilled, you have to use slightly different command and some piece of business logic "Latest tag have the highest revision number"

>svn ls -v http://mayorat.ursinecorner.ru:8088/svn/Hello/tags/
     22 lazybadg              июл 17  2010 ./
     11 lazybadg              июл 17  2010 1.0/
     22 lazybadg              июл 17  2010 1.1/

output of this ls can be gawk'ed, most recent revision found in $1, relative path of needed tag in $6 (or $5, I'm lazy to test)