Branch specification for triggered build

Answered

Good day. i have following VCS specification:

default branch: refs/heads/develop
branch specification:
+:refs/heads/master
+:refs/heads/release/*
+:refs/heads/feature/*

 

i have several configuration one of them triggered by gitlab on mergre-request created

i see that triggered build start in team city but also i see following message:

The build was triggered in the branch feature/VTS-582 which does not correspond to any branch monitored by the build VCS roots (the branch is either closed or excluded / not matched by any branch specification). Because of that default branch revisions were set to this build.

for example this build triggereg in feature/VTS-582 branch and i can see this information on build list page:

 

so i can't understand where i do a mistake

2 comments
Comment actions Permalink

Hi Anatoly,

 

there are some possibilities here. First, you have set "refs/heads/feature/*" but then the branch is being displayed as "feature/NAME". This would mean that your release or feature branches are expected by teamcity to be "refs/heads/feature/feature/NAME", since the branch tag displayed corresponds to the logical branch name, which in your specification is matched by the asterisk alone. If your branch was being correctly picked up it would only show NAME instead of feature/NAME : https://www.jetbrains.com/help/teamcity/working-with-feature-branches.html#Logical+branch+name

 

With this in mind, you are probably forcing the "feature/NAME" build somehow, which teamcity tries to use but because it does not match as mentioned above, it falls back to the default branch. To solve the problem we would need to understand exactly how you are triggering this builds. If you are forcing the branch name via some parameter (such as teamcity.build.branch) this could be problematic. If you are choosing this branch name somewhere in the UI please let us know how exactly as this would be a rare circumstance.

 

In this scenario you will most likely want to replace "refs/heads/feature/*" with "refs/heads/(feature/*)" as that should cover most of it. Depending on how you try to force the branches, though, there might be some more actions required.

0
Comment actions Permalink

ok, thank you for response.

 i tune my setup and now all works fine:

in vcs i have following branch specification:

+:refs/heads/(*)
+:refs/heads/master
+:refs/heads/(release/*)
+:refs/heads/(feature/*)
+:refs/heads/(hotfix/*)
+:refs/heads/(bugfix/*)
+:refs/(merge-requests/*)/head

 

for deploy to test i have following trigger:

+:develop
+:refs/heads/develop

 

for deploy to staging i have following trigger:

+:master
+:refs/heads/master
+:release/*
+:hotfix/*

 

this seem like a kind of magic, but i hope that i have more time in future to understand and use it more correctly, but for now - it works

 

0

Please sign in to leave a comment.