How to trigger one TeamCity build for multiple commits but one merge into a branch

Viewed 6056

I am trying to trigger a single teamcity build for a single merge in VCS. The way my CI is laid out is I one branch staging which we merge all of our changes into. Then when we want to deploy to production we merge staging into the master branch in git. Unfortunately this triggers a lot of builds, one for probably every checkin to the staging branch. So instead we would want that to be a single build. Because it was a single merge into the master branch.

So, does anyone know how to trigger a single build on a change in VCS no matter how many check-ins from how many different people were made?

The options I have selected in the build triggers in team city are the following.

 Trigger a build on each check-in
 Include several check-ins in a build if they are from the same committer

I think I could do it with a custom build trigger but I would rather not go down that path.

Thanks in advance for the help.

2 Answers

You need to use or override the Quiet Period instead for the branch that's handling the staging merges.

I'm guessing that in order to specify the quiet period for only that branch, you'll probably need a separate build config. Take your main build config and on any screen where you're administering it, you should see a button on the right to "Extract Template."

You can then use that template to create another build config for your staging branch, and override the quiet period on the trigger for it.

Related