0
votes

I have two TeamCity builds. One builds any one of my branches, the other deploys a branch built with the first build to an environment. Essentially, the only parameter of interest for the first is the branch name, and the only parameter of the second is the branch name and environment name.

I now want to set up a set of builds such as Deploy Branch X to Environment A, or Deploy Branch Y to environment B.

However, I cannot find any way to create a teamcity build that runs other teamcity builds with hard coded parameters.

Is this possible?

I can't use artifacts or dependencies because I still want Build/Deploy to be triggered manually - without the user having to remember the branch or environment name.

I've looked at meta-runners and chaining, neither seem to offer what I need which is simply run Build 1 with these parameters, then Build 2 with these other parameters.

Any help would be much appreciated!

2
Have you looked at creating a build template that does your build X then Y and then creating a build configuration from said template with your specified parameters?David Peden

2 Answers

1
votes

Thanks for the help on this one everyone, this is what I ended up doing:

  1. Creating a new build that essentially does all of the tasks of build 1, then the tasks of build 2 (build and deploy).
  2. Turning the new build into a template.
  3. Creating builds from this template that specify values, e.g. Branch A, Branch B. These can then have timers etc.

This is essentially what DPeden said, so thank's for the advice!

0
votes

You have two build configs 'Build A' and 'Build B', create a branch name build parameter for 'Build A' and branch name and environment name for 'Build B', use these however you see fit.

See: http://confluence.jetbrains.com/display/TCD8/Configuring+Build+Parameters

Then, create an empty build configuration 'Build C' and set the build triggers for 'Build A' and 'Build B' to run after successful run of 'Build C'.

See: http://confluence.jetbrains.com/display/TCD8/Configuring+Finish+Build+Trigger

Whenever 'Build C' is run to completion, 'Build A' and 'Build B' will be kicked off afterwards.

Note that 'Build C' can have it's own triggers, like 'build at a specified time.