Retrieve SubFolder SVN rev numbers

I am looking at using teamcity for deployment (compile visual studio solution, command line compile installshield, copy to the network).

Currently our deploy consists of two main sections 1. Dll's and Exe, 2. Firmware files not included in our solutions.

Out SVN is setup as:   

Root Folder: Project

Sub Folder: Firmware

Sub Folder: VisualStudioSolution

Our versioning for our application is Major.Minor.FirmwareFolderSvnRev.VisualStudioFolderSvnRev

This aids in when a customer has an issue we can simply look at svn for the rev's to see what firmware and what PC software they are using.

In teamcity I am trying to get the two rev numbers.  I tried adding two roots but no matter what I point to I only get back the larger number.

I tried %build.vcs.number.Firmware%  %build.vcs.number.VisualStudioSolution%  and %build.vcs.number% but all just return the same number.  Is there anyway to get the current rev the root is checked out to for each one?

0
1 comment
Official comment

Hi,

   TeamCity does not provide a way to report the latest commit number under given folder.

   You can use service messages to report build number from the script manually, as the first command-line step in the build.

   And, you can obtain the latest commit number using command-line svn client after the checkout, like 

 

FIRMWARE_REV=`svn info Firmware| awk '/Last Changed Rev/ {print $4}'`

VSS_REV=`svn info VisualStudioSolution| awk '/Last Changed Rev/ {print $4}'`

echo "##teamcity[buildNumber '1.3.$FIRMWARE_REV.$VSS_REV']"

Hope, this helps,

 

Please sign in to leave a comment.