Build parameter in VCS trigger doesn't work
Hello,
I have TFS repo which contains two branches and one shared project which is used by both branches:
SharedProj
MyProj
MyProj-Train
...
I'm using Teamcity 2017.2.2 (build 50909). I have build configuration template with build VCS trigger:
+:root=...:SharedProj/**
+:root=...:%env.ProjBranch%/**
Environment parameter ProjBranch is defined in a top teamcity project. I have two subprojects based on this build template and they overrides this ProjBranch parameter to "MyProj" and "MyProj-Train" values respectively.
Trigger fires for both teamcity subprojects when I check in something into SharedProj, but doesn't when I check in something into MyProj or MyProj-Train branches. It even doesn't show any pending changes (looks like it doesn't track those branches). As I know, build parameters should work in VCS triggers. Am I missing something?
UPD. I checked in some changes into MyProj branch and VCS trigger fired for that build configuration. BUT when merge those changes into MyProj-Train branch build has not been triggered. Even when I check in something directly to that MyProj-Train branch the trigger doesn't fire. Here's a screenshot of Teamcity Changes tab:
First comiit was directly checked in into MyProj-Train branch, second - merge third commit from MyProj branch into MyProj-Train branch. As you can see, first two commits have not triggered build. Both configurations are inhereted from single build template and have original settings. Only this ProjBranch parameter is overriden but it's correct because I'm using it in a lot of other places and everything works fine.
Please sign in to leave a comment.
You mention using TFS, but TFS has support for git. Could you confirm whether you are using TFS itself or the git integrated into it?
Also is the same build configuration affected or are they different configurations for each branch?
A given revision is only built once in a given build configuration. If you merge that same revision into another branch, and the result of the merge in the new branch is the same revision (such as git's fast forward), then TeamCity by default will not trigger a new build on it. You can change this behavior by using the parameter teamcity.vcsTrigger.runBuildOnSameRevisionInEveryBranch (set it to true in the build configuration or project)
If this is not the case, could you share screenshots with the configuration of your VCS Settings on the build configurations, as well as the VCS Triggers for each build configuration?