Continuous Integration with Assembly Version task



Changgyu from Avanade brought this interesting problem to my attention –


If you are using Continuous Integration with Assembly Version task, build server will go into infinite recursion of builds.  Each CI build will update the assembly version and the task will make the checkin, which in turn will ask the CI web service for another build.


Luckily, Changgyu found a simple and elegant solution for this.  The Assembly Version task makes the checkin with a fixed comment string and while subscribing for the checkin event, you can use that info as the filter. To do this, just pass following extra switch to the BisSubscribe command that you are using for subscribing to the event –


/filter “(Comment<>’Auto-Build: Version Update’)”


where ‘Auto-Build: Version Update’ is the fixed comment string.


Special thanks to Changgyu for sharing this.


Thanks.

Comments (2)

  1. Rob Caron gives us the May Team System Webcasts.

    Buck Hodges shows us how to compare the content changes…

  2. pmcevoy says:

    Hi Gautam, I wanted to add this comment to your original AssemblyInfo posting, however comments are disabled…

    Anyway, my problem with the targets as you have defined is that the following will happen using default teambuild.targets:

    ..

    Get

    Checkout

    Label

    UpdateAssemblyInfo

    Compile

    Checkin

    My issue is that the label would be applied to AssemblyInfo files in source control that do not contain the updated version numbers – these would be checked in AFTER the label had been applied.

    I’m new to this, but what I did was to redefine the PreBuildDependsOn to be:

    InitializeWorkspace;

    BeforeGet;

    CoreGet;

    AfterGet;

    And then added a custom AfterCompileDependsOn that looks like:

    CheckInAssemblyInfo;

    BeforeLabel;

    CoreLabel;

    AfterLabel;

    Does this sound right to you?

    Pete