It depends what you are trying to do.
1) Do you want the build + staging to run as one operation? So that you end up with one consolidated build report, one log file, one job in the server's build queue, every step executed sequentially by the same Build Agent that executed the previous step?
If so, then you are on basically the right path. I wouldn't <Exec
> out to tfsbuild.exe though -- running an entire new build has a lot of overhead, and I'm not sure what the potential side effects are. Instead, I would use the <Call
> task to execute msbuild tasks defined in your staging script(s).
2) Do you want the "build build" to actually queue a separate "staging build"? Separate reports, log files, & spots in the queue? Opportunity to be executed in parallel if you have multiple Build Agents?
If so, then:
- create a new build definition(s) for staging
- add some code to your original build definition that queues [one/several] of the new build definitions using the Team Build API. Sample code.
- remove anything not related to the core build from the original build definition
- make sure the new "staging" definitions don't have any automatic triggers (time intervals, checkin events, etc)