Out of the box support
The TeamCity alias, which returns an
ITeamCityProvider instance can be used to interact with the TeamCity environment.
The following example writes an error message if running on TeamCity:
if (BuildSystem.TeamCity.IsRunningOnTeamCity)
{
BuildSystem.TeamCity.WriteStatus(
"This is a error message.",
"error",
"Error details."
);
}
else
{
Information("Not running on TeamCity");
}
Running Cake
The recommended way to run Cake on TeamCity is by using a tool manifest.
Add a command line build step with:
dotnet tool restore
dotnet cake
Available 3rd party extensions
Addin to enable code coverage reporting from an OpenCover result XML file to TeamCity