SVN Labelling

The project this refers to has several configurations:
A Compile configuration, which monitors VCS and builds the code, unit tests and then creates an installer.
A bunch of deploy configurations, which use psexec and nant to get the installer installed on various different environments.

This question refers to the deploy configurations, which are linked to the same VCS, but are not triggered by it.  They just have dependencies on the artefacts.

Currently the VCS page (step 2) and the help page suggest "Use %system.build.number% for build number substitution", implying to me that other environment variables can be used in this place.  We have tried every combination of  2008.8_PRJ10_%env.BUILD_VCS_NUMBER.1%  (release, deployed server, hopefully revision in VCS).

We have tried:          
%env.BUILD_VCS_NUMBER.1%
%env.BUILD_NUMBER_FORMAT%
${env.BUILD_VCS_NUMBER.1}
${env.BUILD_NUMBER_FORMAT}
%system.build.vcs.number.1%
%system.build.number.format%

All we get is a tag with the variable as a literal string in in our tags folder.  So at least tagging is working and we got the SVN mapping working correctly.

If we use the suggested %system.build.number% it works, and we get  2008.8_PRJ10_24 (eg).  We want the revision as part of the tag because it means it is intrinsic to the repository, and we don't have to look up a random number somewhere else.  eg: A lowly PM with repository browse access would know the build #, but if he doesn't then have TC access, he would have no idea what that number meant.  If it was the VCS revision, he could then look deeper into the repository.

So, how can we get some form of %env.BUILD_VCS_NUMBER.1% in our label?

7 comments
Comment actions Permalink

Luke,

What TeamCity build do you use?

3.x only supports %system.build.number% references.
4.0 will support other properties known on the server-side, like %system.build.vcs.number.1%

--
Best regards,

Yegor Yarko
Project Manager (TeamCity)
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

0
Comment actions Permalink

I have a related question.

I have a repository configured like this:

/--trunk
|  +- Project1
|  +- Project2
|  +- Project3
|  +- Project4
|  +- Old.Project5
|
+-tags

The dependencies are such that Project1 builds, followed by Project2, and then Projects 3 and 4 each depend on Project2. Old.Project5 is no longer used.  Each build configuration checks out only its own source code, and uses the Last Successful artifacts from the upstream builds as inputs.

Ideally, I would like for the tags to look like the trunk: /tags/build-n with Projects 1-4 beneath it, Old.Project5 not being tagged, and have one tag applied at the end of the build cycle containing just these sources.  Is there a way I can do this in TC 3.1.2 (build 6878)?  Will there be a way in TC 4.0?

0
Comment actions Permalink

Thank's Yegor,

That's answered my question.  We use 3.1 (got our licence keys yesterday ^_^), and are waiting for 4 to be baked before upgrading.

Regards,

Luke

0
Comment actions Permalink

Couldn't you just do the tag mapping for the VCS root?

/trunk/project1 => /tags/project1
/trunk/project2 => /tags/project2
/trunk/project3 => /tags/project3
/trunk/project4 => /tags/project4

Ah, I just read what you want more clearly.  You want to create a tag directory with the build number.

/trunk/project1 => /tags/{0}/project1
/trunk/project2 => /tags/{0}/project2
/trunk/project3 => /tags/{0}/project3
/trunk/project4 => /tags/{0}/project4

Does that work? Mabe try
/trunk/project1 => /tags/%system.build.number%/project1
or
/trunk/project1 => /tags/%env.BUILD_NUMBER%/project1

I'm just guessing here ^_^

0
Comment actions Permalink

Mark,

I am afraid this is not possible at the moment. if your VS root points to trunk, all the projects including Old.Project5 will be labeled.
Please create a feature request in our tracker.

--
Best regards,

Yegor Yarko
Project Manager (TeamCity)
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

0
Comment actions Permalink

Thanks, Yegor.  I've logged http://www.jetbrains.net/tracker/issue/TW-6334 to hopefully address this.

0
Comment actions Permalink

I have exactly the same issue and haven't been able to find any solutions for it in TC5.0 so far. The documentation clearly refers to a setting like the one in the question here (http://www.jetbrains.net/confluence/pages/viewpage.action?pageId=15802260) but trying that I get this:

Failed: Failed to set label 'CO-BUILD-49': Svn labeling failed: Cannot copy 'root/trunk/Core', 'root/trunk/db' to the same directory 'root/tags/TeamCity/MyProject/CO-BUILD-49'

0

Please sign in to leave a comment.