2
votes

using jenkins 2.46.1 and Subversion plugin 2.7.2 when doing a checkout fron SVN server - there is not SVN_REVISION environment variable created. The only thing I have is SvnServerURLand SvnUsername

How can I get the SVN_REVISION number as environment variable or alternatively a simple solution to retrieve it in jenkins as a parameter?

2

2 Answers

0
votes

Use the below command in add build step as Shell or batch command

echo %SVN_REVISION%

It will display the head svn revison number.

-4
votes

Revision number of a specific file or directory path can be accessed using this command in command prompt on windows:

svn info --show-item last-changed-revision <put_your_svn_URL_here>

NOTE: this works with svn client CollabNetSubversion version 1.9 or higher