Same build configuration for two svn branches

Hi!

I have a build configuration that builds the setup of my project. This build runs automatically when a commit is detected in svn.

Sometime ago I created a branch in svn and want to commit some things there and run the same build on the branch.

I started by creating a new VCS Root configuration to point at my branch instead of my trunk.

Approach A)

I attached the branch VCS Root to my build configuration. So now my build configuration has two VCR Roots attached to it.

But... what's next? I would expect that build configuration runs for each VCS Root separately and get the artifacts of each root separately.

Approach B)

Instead of attaching the branch VCS Root to my original build configuration, I created a copy of it and attached it there. So now I have two identical build configurations each pointing to different VCS Roots (one to the trunk and one to the branch). So now I have my artifacts created separately.

My problem is this. My trunk and branch build configurations correspondingly have "Build number format" equal to "2.1.0.{build.vcs.number.<trunkRepositoryName>}"  and "2.0.1{build.vcs.number.<branchRepositoryName>}". However when the branch configuration is built the latest revision number of the trunk is used to form the build number.

5 comments
Comment actions Permalink

Hello Dimitris,

   Currently, TeamCity provides repository root revision as build.vcs.number.* variable.
   To get latest path revision, consider using the following plugin: http://www.jetbrains.net/confluence/display/TW/Groovy+plug
   It provides build.vcs.lastIncluded.revision property, this is probably what you need.

   Hope this helps,
   KIR

0
Comment actions Permalink

Hi and thanks for trying to help me out!

I tried to install this plugin. Please see attached the current situation in my .BuildServer folder. I think I did all the installation instructions steps.

I also replaced my build format number with this: 2.0.1.{build.vcs.lastIncluded.revision} (I tried with and without VCS Root name).

However this placeholder is not replaced during build. Any ideas?

edited: The version I get is #???



Attachment(s):
22-9-2009 9-52-53 πμ.png
0
Comment actions Permalink

Hello,

  I'm afraid the substitution doesn't work directly for the build number.
  But there is a workaround:

  Given that you use Ant to build your project, consider adding the following snippet to your build script:

  <property name="my.build.number" value="2.0.1.${build.vcs.lastIncluded.revision}"/>
  <echo message="##teamcity[buildNumber '${my.build.number}']"/>

  This will set build number to given value.

  Please read more about interaction between build process and server.

  Hope this helps,
  KIR

0
Comment actions Permalink

Well, I hope that you will do something about this. One would expect that when the original {build.vcs.number} is used it is replaced by the latest revision taken under consideration for that build and not the latest revision of the repository. Without the use of plugins and extra code in the build script.

The whole thing with the plugin and the script is marginally complex enough not to implement.

0
Comment actions Permalink

I'm agree with you, the workaround with plugins is, well, workaround.
Please consider voting/watching the issue http://jetbrains.net/tracker/issue/TW-4527 .

Kind regards,
KIR

0

Please sign in to leave a comment.