BaltoStar
BaltoStar

Reputation: 8967

TeamCity Snapshot Dependency GitHub branch

I have a pipeline TeamCity 7.1 project with multiple configs.

Config "MyBuild" builds a project for a VCS Root pointed at a GitHub repo with multiple branches and has Branch Specification = +:refs/heads/*

Config "MyDeploy" deploys the package created by "MyBuild" and has a snapshot dependency on "MyBuild".

I am finding that "MyDeploy" will always trigger "MyBuild" for the master branch -- even if there exists a more recent build for some other branch.

Is it possible to configure "MyDeploy" to either (1) deploy the latest successful build for a specific branch, or (2) deploy the latest successful build for any branch ?

Upvotes: 4

Views: 1764

Answers (2)

paulius_l
paulius_l

Reputation: 4993

I have just faced the same problem. There are two workarounds that I have found:

  1. Set the dependency on the particular "MyBuild" manually before running the "MyDeploy"
  2. Uncheck the "Do not run new build if there is a suitable one" in the configuration's dependencies. I did not like this approach because it starts a new build of "MyBuild".

Upvotes: 0

Greg Smith
Greg Smith

Reputation: 2469

Seems like you can't do it, yet.

From the Team City Docs:

If build configuration with branches has snapshot dependencies on other build configurations, when a build in a branch is triggered, all builds from the chain will be marked with this branch too.

It is currently not possible to configure artifact dependencies to retrieve artifacts from a build from a specific branch, artifact dependencies always use builds from default branch. The same applies to finish build trigger. It will only watch for finished builds from default branch.

Upvotes: 2

Related Questions