Share FULL Build Number Across Configurations

I have 3 build configurations:

  - Red
  - Green
  - Blue

Green and Blue are snapshot dependancies of Red.  So when Red is triggered...  Green and Blue run first... Red runs last.

What i want is all three to have the same build number of 1.2.3.XXX where XXX is an auto incremeting build counter.

My first try was the so called "Shared Build Number" plugin...

  http://java.nicholaswilliams.net/TeamCityPlugins/introduction#SharedBuildNumber

Set it up.... what do i get?

  Blue = 1.2.3.100
  Green = 1.2.3.101
  Red = 1.2.3.102

This plugin is obviously useless in sharing the build number if it auto-increments on snapshot dependencies.

My next try was the "Overriding  Dependencies Properties" as defined in the TeamCity 9.x docs:

  https://confluence.jetbrains.com/display/TCD9/Predefined+Build+Parameters#PredefinedBuildParameters-OverridingDependenciesProperties

So in the Green and Blue configurations i set the build number to:   %MySharedBuildNumber%

In the Red configuration i added a "Configuration Parameter"...

   Name:   reverse.dep.*.MySharedBuildNumber
   Value:   1.2.3.%build.counter%

I then reset the current build counters to 100, 200, and 300 in Red, Green, and Blue configs respectively.  So now what do i get?

  Blue = 1.2.3.301
  Green = 1.2.3.201
  Red = 1.2.3.101

It seemed like it wasn't reading the reverse.dep value correctly.  So i changed the value on it to "1.2.3.XXX"....

  Blue = 1.2.3.XXX
  Green = 1.2.3.XXX
  Red = 1.2.3.XXX

So the reverse.dep is being passed from the Red config down to the Blue and Green configs...  it just isn't evaluating things within a configuration parameter value.  So the %build.counter% was being passed and not the value of build.counter from Red.

At this point i'm out of ideas.  I've been working on this for a day...  a whole day wasted to figuring out what should be a basic feature.  A feature that has been in the TC issue tracker since 2008 and still isn't resolved.

1 comment
Comment actions Permalink

Hi Tom,

Please vote for this feature request: https://youtrack.jetbrains.com/issue/TW-7745. Also reverse.dep parameters values are passed down the dependency chain as is. Please vote for https://youtrack.jetbrains.com/issue/TW-40772.
As workaround you can create additional build configuration Yellow, where the buildNumber parameter is specified. Green and Blue depend on Yellow. In this case you will be able to use dep.<btID>.buildNumber parameter in all builds in chain.

0

Please sign in to leave a comment.