As can be seen on the TeamCity page FAKE is really easy to setup in TeamCity, it also support some advanced scenarios to integrate even deeper with it.
By default each Target already is displayed as a collapsible block in the log file :
But blocks can be created in targets to separate operations more cleanly :
1: 2: 3: 4: 5: 6: 7: 8:
While TeamCity has a great configurability in terms of artifacts, nothing beats specifying them in code.
FAKE scripts also have the advantage of being versioned along the rest of your code, avoiding the need to keep complex artifact configurations when you need to support a new branch along with old ones or the need to configure artifacts in each build if you have multiple builds on the same repository.
1: 2: 3: 4: 5: 6:
Each build is assigned a build number in TeamCity that is available as
TeamCityBuildNumber from FAKE
and that is shown in the TeamCity dashboard :
But TeamCity also support that builds customize their version number by reporting it directly, using this feature from FAKE is simple and when coupled with other parameters reported by TeamCity can allow complex versioning schemes.
This code read versions from a release notes file and if TeamCity is detected label versions as pre-release when they come from a branch that isn't the default one or from a personal build :
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17:
In addition to artifacts, TeamCity also allow to report test results that will be visible in the dashboard directly from the build.
Each test runner has a specific function to send it's result that can be found in the TeamCityHelper API like here for NUnit :
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12:
Note: NUnit version 3 is a special case as it directly support TeamCity and it's
enough to set
TeamCity = (BuildServer = TeamCity) in
val int : value:'T -> int (requires member op_Explicit)
type int = int32
type int<'Measure> = int
type Version =
new : unit -> Version + 4 overloads
member Build : int
member Clone : unit -> obj
member CompareTo : version:obj -> int + 1 overload
member Equals : obj:obj -> bool + 1 overload
member GetHashCode : unit -> int
member Major : int
member MajorRevision : int16
member Minor : int
member MinorRevision : int16
System.Version() : System.Version
System.Version(version: string) : System.Version
System.Version(major: int, minor: int) : System.Version
System.Version(major: int, minor: int, build: int) : System.Version
System.Version(major: int, minor: int, build: int, revision: int) : System.Version
System.Version.ToString(fieldCount: int) : string