I have a Teamcity Project with VCS Root configured like this:
- Default branch:
develop - Branch specification:
+:refs/heads/(*)
I hope it means I may pass any branch name and it will be processed successfully.
The project contains two builds. Let it be STEP_A and STEP_B.
STEP_B has a trigger finishBuildTrigger:
{ buildType = "${STEP_A.id}" branchFilter = "+:*" }
which means it will starts after the STEP_A ends.
I want to run all the builds via REST API. I do POST /app/rest/buildQueue with parameter branchName = "feature_222".
Ok, I see that STEP_A successfully starts with feature_222 branch checkout. After it ends STEP_B starts to run BUT with develop branch checkout. Of course, it is not a desirable behavior.
What should I do to fix that?
I would re-configure this pipeline to rely on the snapshot dependency rather than on the finish build trigger. So, follow the steps below:
finishBuildTriggerDeployconfiguration toBuild)This is how it looks like:
According to the docs:
To tell it short, the snapshot dependency is the mechanism to enforce the same version (snapshot) of the sources being built by the build chain.
See the official documentation for more details.