0
votes

I'm fairly new to TeamCity (but not to CI systems) and I've been trying to figure out how to work this configuration out:

I have latest TeamCity Professional Version 9.1.3 (3 build agents, 20 configs) installed

Here's my TeamCity Project layout:

Project A
-- Build Product X (WIN)
-- Build Product Y (WIN)
-- Build Product Z (Linux)

I have dedicated 3 agents to build the above build configurations accordingly - 2 on Windows and 1 agent on Linux

WIN products are built using a mix of batch, powershell and msbuild scripts
Linux product is built using shell script

Triggering these 3 builds (under Project A), manually, works just fine. However, this is not feasible as we have many feature branches and all of them would have similar build configurations - 3 clicks for each build + setting Build Parameters on each Build configuration is expensive.

So, Here are my questions:

  1. Is there a way to trigger the entire Project to build with a Single click? doing so, should run these builds in parallel
  2. If 1 is possible, then how do I set the same build number (build params) across these 3 build configurations?
  3. Is it possible to set up a VCS trigger that would poll for changes on any of the repos that build these and trigger the entire project (provided 1 is possible)

Please note I tried configuring both snapshot and artifact dependencies to make this work, but creating dependencies only pauses the other build configurations to wait until the dependent project is complete but that's not feasible for us - they need to run in parallel. (our builds take approx 45mins to complete) - Yes, we have a huge product to package.

I'll be grateful for any pointers in the right direction

Thanks

1

1 Answers

1
votes

Yes, one-click triggering of parallel runs is achievable: create a 4th (or 0th) build configuration that does nothing (no build steps). Let's call this config "Zero". Your three build configs will each have a "Finished build" trigger on Zero (trigger when Zero finishes) as well as a snapshot dependency on Zero.

The best bit: you only need to define the common/shared parameters in Zero and the other three configs can reuse these. For example, if you define %foo% in Zero, the other three can all use %dep.MyProject_Zero.foo%. This also means you can get at Zero's build number: %dep.MyProject_Zero.build.number%. In each of your three build configs, switch to the "General Settings" and set your "Build number format" to the above.

For VCS triggering, just set Zero to span all the three VCS areas. You're suggesting they are each in a different repo... I have no experience with that but assume that Zero can span all three repos.

Last, if you use feature branches, and your VCS is git, mercurial, or Perforce Streams, make sure you've read about TeamCity feature branches support; it can save you a lot of time!