How to trigger specific build steps for each build configuration

We are using teamcity to build our web sites.

We have a project that contains multiple sites, then each site has it's own (10) build configs. The build steps are identical for each site and we use a system.parameters that's different for each config that's the name of the site. (ex. stage-1, stage-2, etc..)

 Also to note, each build config for each site (built off template) has 20 steps, but the 6 that I'm concerned about are.

1. Enable Maintenance web page for site.

2. Disable monitoring

3. Stop message processors.

4. Enable message processors

5.  Enable monitoring

6. Disable Maintenance we page for site.


So all those steps * 10 for each site.


What I'm looking to do is out of the 20 build steps fire off only steps 1,2,3 to just throw up the maintenance banner for each of the sites, then a different build step for 4,5,6 to disable the maintenance banner for each of the 10 sites.

2 possibilities.


1. Create a build config that uses command line that access the api to trigger individual steps.

2. Create a build config that can somehow cycle through a system parameter that contains a list of names of each site. (stage-1, stage-2, stage-3, etc...)


I'm not sure if either option is possible or how to move forward to implement  such a thing.


Thanks in advance for any assistance to resolve this issue.



1 comment
Comment actions Permalink

Hi Kevin,

There is no option in TeamCity to trigger a specific build step.
The common approach is to have separate build configurations for different tasks. For example, you can have a build configuration for the first 3 build steps, that throws up the maintenance banner. And have dependent build configurations that perform other steps. You can use build configuration templates to simplify the setup. In this case you'll be able to trigger needed build configuration or the whole build chain.


Please sign in to leave a comment.