Search code examples
continuous-integrationteamcitybuild-process

How to run the same build with different predefined parameters in TeamCity


I try to improve our build process and use 2-3 predefined parameters for run on one single build.

Description: we have build configuration with parameters C1, C2, C3 and related build steps B1, B2, B3. They link to each other C1-B1, C2-B2, C3-B3. In this scheme all works fine, I pass parameters like mentioned here - How to pass Arguments between build configuration steps in team city?,

but I'm a bit worried because B1, B2, B3 are full copy each other and this i would like to improve it. Only one problem I couldn't find any mechanism to pass parameters from different configuration.If I use %dep. mechanism i can use parameter from only one configuration.

UPD: Currect scheme

+---+   +---+   +---+
|   |   |   |   |   |
| C1|   | C2|   | C3|
|   |   |   |   |   |
+-+-+   +-+-+   +-+-+
  |       |       |
  |       |       |
+-v-+   +-v-+   +-v-+
|   |   |   |   |   |
| B1|   | B2|   | B3|
|   |   |   |   |   |
+---+   +---+   +---+

the desired scheme:

+---+   +---+   +---+
|   |   |   |   |   |
| C1|   | C2|   | C3|
|   |   |   |   |   |
+-+-+   +-+-+   +-+-+
  |       |       |
  |       |       |
  |     +-v--+    |
  |     |    |    |
  |     |    |    |
  +-----> B1 <----+
        |    |
        +----+

C1, C2, C3 setup configuration parameters B1 contains only build steps, like clean, build, dist

Could anyone help me with that? Any ideas?


Solution

  • In your case, you can introduce a TeamCity Metarunner. The idea is that you combine multiple build steps with parameters, and extract them as new entity, available as build runner.

    See this documentation section for step by step instructions on creating a metarunner.