TeamCity Building separate pull request in a multi VCS setup

Answered

I am trying to setup TeamCity 10 for a larger project. We have 3 different GitHub repos which all are needed to build. They can't be build individually as the setup is today. If I set up the project with all of the GitHub repos I can put them all in one folder an successfully build everything.

The structures basically just looks like this:

  • Base repo
  • UI repo
  • Plugins repo

Which all checks out to the same folder and start building.

My problem now is that I need to run build on specific pull request per repo. I need a way to manually or automatically start a build for example PR 1234 on Plugins repo and then use the master on the rest of them.

I've tried several setups but I just can't get it to work as I want to. The best would be if the manual build start popup would have the "branch" drop-down menu for each of the repos but it always just have that one.

I thought about using snapshot dependencies but it seems like that would require each of them to be built individually which currently can't be done. I want them to be "pulled" individually and built as one project.

I appreciate any help on the issue and feel free to ask questions if something is unclear. Is this something that can be done?

Thanks!

0
1 comment

Hi Sammex,

Snapshot dependencies wouldn't work either. When a branch is determined on a trigger, it will be transitively sent throughout the dependencies, so any matching branches on the other repos would as well be pulled instead of the default. Also, your suggestion about the custom build dialog showing different branch options was already done before. If you want to stay informed on its progress, please vote and watch here: https://youtrack.jetbrains.com/issue/TW-26447

Doing this fully automatically isn't possible right now, not at least without a lot of tinkering that would depend a lot on the specifics of your project. You could create a set of different build configurations that track the different roots, then trigger through a finish build trigger a different build that will pull master from the missing roots into a common folder, then trigger a final build that performs the actual build with the contents of that same common folder. Finish build triggers don't respect branch information if a dependency is not set, but then the build queue and build results would be really cluttered.

Doing it manually is possible with some configuration. You can select "Do not checkout files automatically" on the VCS configuration of your build. Add a first command line build step where you select and checkout manually the builds, and select the remotes/branches via parameters, then configure this parameters as parameters for the build, and you should be able to pull the correct branches from the right Roots.

For example, configure a parameter that decides which root to pull a branch from, then a user running a manual build selects the branch (a dropdown can be used), then the first step takes this parameter, changes all roots to master, pulls the changes from this branch (branch selected in the run dialog, is by default accessible through a parameter) and does the checkout of that branch in the specific folder, then a second build step runs the build itself with the master-master-branch configuration.

0

Please sign in to leave a comment.