Reputation: 3594
we have a situation where we have many builds running at the same time, but we need to serialize the results going in. At various checkpoints in the build, we basically say "if something has made it in to the main branch, fail this"... what we really want to do is say "if something has made it into the main branch, go back to the first step".
Is there any way with teamcity to go to a different build step?
ie create a loop within a build? (without putting the whole build into a single step)
Upvotes: 1
Views: 273
Reputation: 3739
If you want to do it in a A=>B => A mechanism, you can try doing this within a Build chain.
A is your first build. B is your test build. C is your dependent build.
B is dependent on A and C is dependent on B
You need to create a build B which polls the repo and checks if there are any changes after build A kicked off. If there are any changes it fail and therefore build C is not triggered and the build chain fails.However due to the new changes, build A is triggered and an entire new build chain is created.
You can also change your vcs polling to set a silent period. For ex you can change your build to wait for 5 minutes before it triggers , just to check if there are any new changes. If there are new changes, the silent period is reset
A better way would be to poll the repository at a longer period than the time taken by your build.For ex if your total build is for 10 min, then poll the repository at 15 min interval. This is however dependent on what you want to achieve and might not suit your purposes
You can also use Teamcity Shared resources to make sure only one target is running at any given time
Upvotes: 0
Reputation: 1269
Try Build Chains
They let you specify the order projects should run in, so that if you have projects A,B, and C, B's trigger is a successful completion of A, and C's trigger is a successful completion of B.
A => B => C
They also let you fork, so that A's success could trigger B & C, and D goes when both B & C complete:
B
A => => D
C
Upvotes: 1