CI Best Practices

Okay, so, I've been using TeamCity for a while now and lately I've been re-structuring some of our CI pipeline by breaking down some very generic "Build Debug Win32" and "Build Release Win64" configurations into configurations to build specific projects. What I need is to be able to build each of these specific project configurations in all configurations and platforms and to get some very specific behavior as far as dependencies are concerned. Assuming I have project A that depends on projects 1, 2, and 3..

A -- 2

The behavior I want is for changes in A to not rebuild 1, 2, or 3, while changes in 1, 2, or 3 will rebuild that project AND A but not the other, unchanged projects. For instance if project 1 changes, it should be build and then A should build but 2 and 3 should not build because they haven't changed.

At first I considered snapshot dependencies on projects 1, 2, and 3 in project A, but I can't get it to not build 1, 2, and 3 if they haven't changed. It will always queue them up because A depends on them. So instead I considered build finished triggers, but then if a single submission changes 1, 2, and 3 it instead puts A in the queue three times.

Also, what is the best practice for building a project under multiple configurations(debug, release, etc., not TeamCity build configurations) and platforms? Should each be a separate project, is there some easy way to handle this via build parameters, or is it considered standard to just lump them all under one configuration as separate build steps?

I'm sure there are easy solutions to these problems that I'm just not seeing for some reason, but after hours of scouring the net some what unsuccessfully and scratching my head a lot any help is welcome!

-- Ryan

1 comment
Comment actions Permalink

I still think snapshot dependencies should work in this case. If A depends on 1, 2, and 3 and option is set "Do not run new build if there is a suitable one", then it should not rebuild 2 if there were no changes detected. Yes, it will add it into the queue, but then, once changes are collected for the whole chain, builds 2, and 3 must be replaced with already finished builds.


Please sign in to leave a comment.