2
votes

Goal: I try to create a Pre-Tested Commits approach (first run CI build with tests, next push them to "green" repository if OK)

Problem: the Branch Remote Run Trigger doesn't work and TeamCity server doesn't pull changes to run the build. I can't understand why is so and how to fix it.

Description:

I have two configurations in one TC project. Both of them watches the same git repository but different branches(as default). There are total 3 branches: master (not used here), develop (for working builds and green tests) and artemPersonal(for personal builds)

  1. WebUI Develop. Uses refs/heads/develop branch only for green repository. New commits comes to this branch from TC after successful personal builds.
  2. WebUI Develop Pre-Tested Commits. Uses refs/heads/artemPersonal as default branch

    2.1 I have a set Branch Remote Run Trigger with path to branch: refs/heads/artemPersonal I tried different variations like refs/heads/*.

    2.2 I have a set VCS root with default branch: refs/heads/artemPersonal And empty Branch specification. I also tried to fill branc specification with some values, but now it's empty.

I push to refs/heads/artemPersonal and expect TC to run Remote-Run trigger to pull changes and start next build. It doesn't. The pending changes appears on UI of TC but build doesn't start. Manually works fine.

the teamcity-remote-run.log file give such messages:

Branch 'refs/heads/artemPersonal' in VCS root '"WebSite Development Pre-tested Commits" is matched by branchSpec, branch will be ignored

and

First run of the trigger for buildType 'WebSite :: WebUI develop Pre-Tested Commits 3 branch(es) matched by the pattern. New commits or new matched branches will trigger a personal build.

P.S. I know the workaround not to use personal builds and Branch Remote Run Trigger and use simple VCS Trigger and check artemPersonal branch only. But I want to use Personal builds.

1
Did you ever get this to work? I run TeamCity 8 and I'm not able to get the build configurations to detect any of the branches that I create (I've used the default 'refs/heads/remote-run/*' following the simple steps in the documentation).ykay
no, I didn't. It was so long about, that I don't remeber the workaround.Artem G
You shouldn't leave it at 'refs/heads/remote-run/*' unless your branch names actually have that in there. For instance, we require branch names to be users/userName/BranchName so the value in the trigger is: ''refs/heads/users/*'.Michiel Bugher

1 Answers

0
votes

I suppose the branch you're using for personal build is refs/heads/artemPersonal. It should not appear in the Default branch or Branch specification list in the VCS Root.

In order to run a personal build you need to define a trigger on each build configuration you want to use. (e.g. Pattern of Branches to Monitor = refs/heads/*). In your case you can use WebUI Develop.

Make sure that you have the same username in Team city and Git.