4

I've got a project in TeamCity, and I want to be able to do two different builds in one go (i.e. two different build steps for the same project).

My MSBuild script takes a 'Configuration' parameter, so on the command line, I can pass in 'Test' or 'Production' and it will build either version for me.

However, the only way I've managed to get this working in TeamCity is to set a Build Parameter, which is global to the entire project (i.e. env.Configuration='Test').

Is there a way to pass different values of the 'Configuration' parameter on a per-build-step basis? I've run into problems before when I tried this e.g. with the 'Command Line Parameters' setting in TeamCity.

Thanks

Richard
  • 1,731
  • 2
  • 23
  • 54
  • How did you manage to get this? – Kjellski Nov 27 '13 at 08:47
  • 1
    Build triggers are the way to go as manojlds said. i.e. have one build config for UAT, and another one for Production, and in the build triggers config section for the Production build, you can set it to trigger when the UAT build has finished. You can limit it to successful UAT builds only too. – Richard Nov 27 '13 at 10:22

1 Answers1

2

You are looking at splitting your build configuration into multiple build configurations and having trigger dependencies between them.

manojlds
  • 290,304
  • 63
  • 469
  • 417
  • You can even have one dummy build configuration that acts as a trigger for your two real build configurations (test and production). That way you can run the dummy build to build both, but you still have the flexibility of being able to run either the test or production build on its own. – Matthew Strawbridge Dec 11 '11 at 09:19
  • Thanks for the tips, appreciate it. I'll give them a try tomorrow and report back – Richard Dec 11 '11 at 22:45
  • Just a quickie - by 'multiple build configurations' am I right in thinking that you mean create a different project for each build config I want? Thanks – Richard Dec 12 '11 at 13:58