0

We had some success using the branches concept of TeamCity in subversion by pointing to tags like mentioned here https://stackoverflow.com/a/6875151/2416394 although we are aware that this is primary for DVCS like git.

We've extended the answer from the link by providing a project parameter %Tag% which became part of the checkout rule. So our SVN Root is http://myserver/svn/tags/ and the checkout rule is +:%Tag%=>. Each time we checkout a new tag is added as "branch" and build the source, this is fine

Now we started experimenting with chained builds. Let's say I have those configs:

  • Source Build
  • Installer-Lite
  • Installer-Full

Both Installers need source, both have it as snapshot and artifact dependency. The main problem is: Tag is a mandatory parameter for Source Build but not for the other, I don't want to replicate all properties to each config. So whenever I trigger any installer, source gets build with %Tag% set to empty.

Which then results in building http://myserver/svn/tags/%Tag% with an empty tag. This checks out all tags in the "Default" branch in one workspace which later fails to build as the structure is different and anyway way to large.

Community
  • 1
  • 1
Samuel
  • 6,126
  • 35
  • 70
  • Do you trigger your builds manually, or using a VCS trigger? If using a VCS trigger, who supplies the value of `%tag%`? – sferencik Sep 23 '15 at 12:57
  • Only manually, I suppose this would be the feature branch detection, if it would be done automatically, which was not designed for svn. – Samuel Sep 25 '15 at 04:17
  • OK, thought as much. Matches my understanding. You may also want to upvote the feature request in the JetBrains tracker: youtrack.jetbrains.com/issue/TW-18911. – sferencik Sep 25 '15 at 05:29

1 Answers1

0

Since Installer-Lite and Installer-Full have snapshot dependencies on Source Build, they can refer to its %Tag% variable using %dep.SourceBuild.Tag% (where SourceBuild is the ID of the Source Build config).

Hence, you can do one of the following:

  • option 1: the checkout rule in Installer-Lite becomes +:%dep.SourceBuild.Tag%=>.
    • this is briefer but slightly less legible
  • option 2: Installer-Lite gets its own %Tag% variable, its value set to %dep.SourceBuild.Tag%, and then the same checkout rule as Source Build, i.e. +:%Tag%=>.
    • more things to set up, but the checkout rules are symmetrical and hence less surprising for the maintainer
sferencik
  • 3,144
  • 1
  • 24
  • 36