0
votes

TeamCity Setup:

Project(CenterProj)

  • Build Configuration (Master Branch)
  • Build Configuration (Dev Branch)

VCS(GitHub) Setup (Repo: CenterProj):

  • Master Branch
  • Dev Branch

Site Setup:

  • dev.centerproj(relates to dev branch)
  • qa.centerproj(relates to master branch)

I have yet to figure out how I can have 1 VCS Root connection going to the CenterProj Repo, and then trigger the 2 build configs based on commit/merge to their individual branches.

  • Example: commit code to Dev branch, TC triggers Build Configuration(Dev) and it goes out to dev.x. I think merge that commit to Master, and it then triggers the Build Configuration(Master) which goes out to qa.x.

So far I'm getting continual "Pending" builds waiting on dev when I commit/merge to master or pending in Master when I commit/merge into Dev.

Suggestions?

1
Is there a reason for having a separate build configuration for each branch (are they doing different steps?) You should be able to have one build configuration and one VCS root and use branch specifications in the VCS root to monitor multiple branches - This can then trigger builds off of different branches in the same Git repository.Evolve Software Ltd
@EvolveSoftwareLtd I was under the impression that should work. The builds are the exact same except the destination is different. one goes to dev.x the other goes to qa.x. I tried branch specifications in the root, so it's monitoring both Master and Dev branches. but still on either branch commit, both build configurations start up.SudoGaron

1 Answers

1
votes

You need to specify a trigger rule for each build configuration, and in there limit which branch will trigger your build. As far as the "Pending" changes, they will appear on top of both build configuration because you are sharing the same VSC root, no need to worry about that.

  1. In the first screenshot, your VSC configuration, set your branch specifications to "+:refs/heads/*"
  2. In the second screenshot, you already have a value in the "Branch Filter," just set that to "+:dev"
  3. In the last screenshot set the "Branch Filter" to "+:master"