0

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?

SudoGaron
  • 339
  • 6
  • 22
  • 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. – Matt Jul 11 '16 at 10:20
  • @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 Jul 11 '16 at 20:09

1 Answers1

1

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"
Ben Richards
  • 3,437
  • 1
  • 14
  • 18
  • http://imgur.com/a/WlrMO - shows album of configuration. In the Trigger Rules, there is no option for setting the branch, only the Root and a file wildcard. – SudoGaron Jul 12 '16 at 12:47
  • 1
    In the first screenshot, your VSC configuration, set your branch specifications to "+:refs/heads/*" In the second secreenshot, you already have a value in the "Branch Filter," just set that to "+:dev", and in the last screenshot set the "Branch Filter" to "+:master". That should do it. – Ben Richards Jul 12 '16 at 13:55
  • That seems to have fixed the issue. It's showing "Pending" on both branches anytime either one gets a commit but I don't think that is going to go away. – SudoGaron Jul 12 '16 at 15:49
  • 1
    Right, "Pending" just means there are changes in source control in any branch. – Ben Richards Jul 12 '16 at 16:05
  • Thank you for clarifying, I'm am still new to the git and CI systems, coming from SVN + manual build/deployment. – SudoGaron Jul 12 '16 at 16:45