9

When I create a new branch B from branch A and do a single commit, TeamCity triggers multiple builds on B, although I would expect just a single build.
I set "Trigger a build on each check-in" to true, but nevertheless there should only be a single build because there is only one new commit. It seems that TeamCity triggers a build for each commit within the current month. All builds of branch A finished and the same build configuration is used to build branch A and B. Can I configure TeamCity to create builds just for the commits that haven't been built (no matter on which branch)?

Johannes Egger
  • 3,874
  • 27
  • 36
  • I've had this happen before, but I'm not sure what the reason was. In this case I cancel all the outstanding builds and then rerun the build, which always seems to batch the changes altogether in one build. – Castrohenge Sep 24 '14 at 15:42
  • Of course this would work, but it's obviously not a sustainable solution. Can you remember if you changed anything or did it just disappear or did you reinstall the whole system? – Johannes Egger Sep 25 '14 at 18:20

2 Answers2

16

It looks like you faced with this issue. As current workaround please try to set

teamcity.vcsTrigger.runBuildOnSameRevisionInEveryBranch=false

You can set it either as a parameter in build configuration - to affect a particular build configuration, or in internal.properties file to affect all build configurations.

Alina Mishina
  • 3,320
  • 2
  • 22
  • 31
  • Thanks, that seems to do the job, although it still triggers a build when a new branch without changes is created. But I guess one build won't hurt. – Johannes Egger Oct 02 '14 at 18:42
  • Where to set this? Exactly? Why can't there be some kind of interface with checkboxes for those boolean values. – Valentin Kuzub Nov 14 '14 at 09:28
  • 6
    You can set it either as a parameter in build configuration - to affect a particular build configuration, or in [internal.properties](http://confluence.jetbrains.com/display/TCD8/Configuring+TeamCity+Server+Startup+Properties#ConfiguringTeamCityServerStartupProperties-TeamCityinternalproperties) to affect all build configurations. – Alina Mishina Nov 14 '14 at 09:32
0

I suppose you have activated the VCS build trigger for that Build Configuration. So, go to that Build Configuration settings page > Triggers > and look for the VCS trigger. Click the edit link and a modal will appear, there will be the option you are looking for: "Trigger a build on each check in": https://confluence.jetbrains.com/display/TCD8/Configuring+VCS+Triggers#ConfiguringVCSTriggers-PercheckinTriggering

Omar
  • 56
  • 2
  • Thanks. Although I want it to trigger on each check-in. But imagine I work on a feature branch which gets continuously built by TeamCity. When I then merge it back to the main branch I don't want a build triggered for each commit as they already have been triggered on the other branch. – Johannes Egger Mar 17 '15 at 18:46
  • So `runBuildOnSameRevisionInEveryBranch` seems exactly what i wanted. – Johannes Egger Mar 17 '15 at 18:46