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?

2
  • 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. Commented Jul 11, 2016 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. Commented Jul 11, 2016 at 20:09

1 Answer 1

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"
Sign up to request clarification or add additional context in comments.

5 Comments

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.
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.
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.
Right, "Pending" just means there are changes in source control in any branch.
Thank you for clarifying, I'm am still new to the git and CI systems, coming from SVN + manual build/deployment.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.