How to trigger expensive build steps only when required? : <p>I have a TeamCity project with the following build configurations:</p>

<ol>
<li>Gather dependencies (expensive)</li>
<li>Build</li>
<li>Test</li>
<li>Deploy</li>
</ol>

<p>Say I know whether I need to do it by changes to some file <code>deps.txt</code>.</p>

<p>Here's what I want to do:</p>

<ul>
<li>I want to trigger builds on all changes in version control.</li>
<li>If <code>deps.txt</code> has changed, I want to run builds 1, then 2, then 3, then 4.</li>
<li>If <code>deps.txt</code> has not changed, I want to run builds 2 then 3 then 4.</li>
</ul>

<p>I tried putting triggers on build configurations like this:</p>

<ol>
<li>VCS trigger on no checkins, unless <code>+:deps.txt</code></li>
<li>VCS tigger on all checkins, unless <code>-:deps.txt</code></li>
<li>Snapshot dependency on 2, trigger when 2 finishes building</li>
<li>Snapshot dependency on 3, trigger when 3 finishes building</li>
</ol>

<p>but if a commit includes changes deps.txt <em>and</em> other files, then configurations 1 and 2 trigger at the same time, meaning that configuration 2 will fail.</p>

<p>Is there an easy way to do this in TeamCity?</p>
