Snapshot dependency overriding queuing policy

I have a question regarding setting up chain builds, I've outlined the scenario below

Source control structure

$/Contoso

$/Contoso/Services/Air

*.cs;   AirServices.csproj

$/Contoso/DTO/Air

*.cs;   AirDto.csproj

$/Contoso/Applications/AirApp

*.cs;   AirApp.csproj


I have the following 3 build definitions:

Air Services

VCS root:

Contoso   ($/Contoso)

Artifact

/**/*=>AirServices.zip

Dependencies

None

Build Triggers

VCS Trigger,   rules:
+:/Services/Air/**



Air DTO

VCS root:

Contoso   ($/Contoso)

Artifact

/**/*=>AirDto.zip

Dependencies

None

Build Triggers

VCS Trigger,   rules:
+:/Dto/Air/**


Air App

VCS root:

Contoso   ($/Contoso)

Artifact

/**/*=>AirApp.zip

Dependencies

Snapshot and   artifact:

  • AirServices
  • AirDto

Build Triggers

VCS Trigger,   rules:
+:/Applications/AirApp/**


Current state

Build definition

Artifact

Last change set

AirServices

AirServices.zip

650

AirDTO

AirDTO.zip

650

AirApp

AirApp.zip

650


Problem

  • I check in /$Contoso/Applications/AirApp/main.cs  Change set: 651.
  • Air App triggers
    • Air Services and Air DTO also trigger a build because the last succesfull artifact was built against changeset 650


Desired behaviour

  • I check in /$Contoso/Applications/AirApp/main.cs  Change set: 651.
  • Air App triggers
    • Air Services and Air DTO are queried to determine if they should be queued
    • Because changeset 651 does not include any files that match the VCS build trigger rules, DTO and Services builds are not queued
    • Only Air App builds


Is there a way to accomplish this desired behaviour?


Regards,

Ed.
1 comment
Comment actions Permalink

Hi Ed,

Sorry for the delay in replying.

Yes, there is a way to achive reusing a build if it does not use a file modified. For this you should configure TeamCity to understnad that only parto of the repository is used.
This is best done with the help of checkout rules which configure which part of the version control to checkout. Most probably you will not need VCS triggering rules after that.

The checkout rules wil most probably look loke:
+:Services/Air=>.
and
+:Dto/Air=>.
for Air Service and Air Dto correspondingly.

Please also make sure the snapshot dependencies are configured with "Do not run new build if there is a suitable one" setting.

0

Please sign in to leave a comment.