James James
James James

Reputation: 367

Replicate msbuild command from TeamCity

I have a TeamCity build which uses msbuildbootstrap to run msbuild. I want to run the same msbuild command on my local machine, but I don't know what parameters TeamCity is passing it. The logs don't say.

[Step 1/3] Starting: D:\BuildAgent\plugins\dotnetPlugin\bin\JetBrains.BuildServer.MsBuildBootstrap.exe /workdir:D:\BuildAgent\work\e8f57dfa2eca8e8c /msbuildPath:C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe
[14:10:12][Step 1/3] in directory: D:\BuildAgent\work\e8f57dfa2eca8e8c
[14:10:14][Step 1/3] depot\Build\Scripts\release.build.teamcity: Build target: PublishRelease (1m:10s)
[14:10:14][depot\Build\Scripts\release.build.teamcity] PublishRelease (1m:10s)
[14:10:14][PublishRelease] CreateCustomBuildLabelTask (1s)
[14:10:15][CreateCustomBuildLabelTask] Creating custom build label from TeamCity build number 7375.
[14:10:15][CreateCustomBuildLabelTask] Generated build label is     2016.02.01.ReleaseCandidate
[14:10:15][PublishRelease] CopyBuildArtifactsTask (5s)

How can I exactly replicate the parameters TeamCity passes to msbuild? Is there any documentation for msbuildbootstrap?

Upvotes: 4

Views: 484

Answers (1)

Vilmir
Vilmir

Reputation: 1330

That's a tough question, because TeamCity does not only send a list of properties as an input for the MsBuild command. It creates a list of environment variables that will be taken into account by MsBuild itself as properties. You can find the defined environment parameters in the "Parameter"s section of your build configuration in TeamCity. They are referenced as "System Properties (system.)".

Once a build has been executed, you can find again the list of system properties in the build result tab named "Parameters" under "System properties".

As a build manager, I don't like this situation, as it can be pretty hard to reproduce a build on a local machine. We use too many system properties today, only specified in TeamCity. I want to shift us to a clear API for executing our builds.

Upvotes: 2

Related Questions