TeamCity Snapshot Build Dependencies

So I was reading this teamcity blog entry: In the sample Build Chain: Compile, Test, Deploy it says “Deploy” is snapshot dependent on “Test” which is snapshot dependent on “Compile”. So I set up Compile, Package and Deploy. Compile is done automatically and package and Deploy are manual. Deploy has an artifact dependancy. But I have a few problems with it. In my case we have two agents.

Problem 1: if Compile is run on build agent 1 and then Package is run on agent 2 then it is not packaging the latest build.
Problem 2: There is a problem when a working directory is cleared. If Compile is run on agent 1, then the working directory is cleared and then Package is run on agent 1, then the latest code will be fetched but won't be Compiled.

What is the best way to fix these issues? The only solution to fix both issues that I've come up with is to instead use Artifact dependancies for Package and Deploy. The problem with this is that now I've doubled my artifact size. Are there any other options?

Comment actions Permalink


Snapshot dependency ensure that builds use the same sources snapshot, but not the same working directory. If you want Package build configuration to pack the results of the latest build you need to configure artifact dependency. If artifacts are doubled in this case, may be it is better to merge Compile and Package in one build configuration, but different build steps.

Comment actions Permalink

Sorry, forgot to mention that there is also a "Run build on the same agent" option available for snapshot dependent build.


Please sign in to leave a comment.