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

2

21

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.

Sanitation answered 4/12, 2013 at 16:36 Comment(0)
A
30

As counterintuitive as it is, unchecking the Trigger a build on each check-in checkbox should solve this issue as long as you have Quiet Period enabled for long enough that all of the checkins are included.

Essentially Trigger a build on each check-in actually means "only include 1 checkin in each build." Disabling the option will still cause builds to be triggered by checkins, but will include all checkins (from all users) that occur before the build actually starts. TeamCity should really clarify this in their documentation or rename the option.

Aflcio answered 17/10, 2014 at 17:25 Comment(1)
yep, this fixed it. if you look in the docs its a little more clear but the dialog is not clear.Carolinacaroline
P
0

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.

Premiership answered 6/12, 2013 at 5:3 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.