Note: This is the migration API reference for FAKE 5. The new (modularized) API documentation can be found here. If the API is already migrated you can check here if exists in a module. More information regarding the migration can be found here

TeamFoundation

native support for Azure DevOps (previously VSTS) / Team Foundation Server specific APIs. The general documentation on how to use CI server integration can be found here

Secret Variables

This CI server supports the concept of secret variables and uses the Vault to store them. In order to access secret variables you need to use one of the fake 5 tasks from vsts-fsharp.

Example implementation (supports runner and vault tasks)

 1: 
 2: 
 3: 
 4: 
 5: 
 6: 
 7: 
 8: 
 9: 
10: 
11: 
12: 
13: 
14: 
15: 
16: 
17: 
18: 
19: 
20: 
   // Either use a local vault filled by the 'FAKE_VAULT_VARIABLES' environment variable
   // or fall back to the build process if none is given
   let vault =
       match Vault.fromFakeEnvironmentOrNone() with
       | Some v -> v // fake 5 vault task, uses 'FAKE_VAULT_VARIABLES' by default
       | None -> TeamFoundation.variables // fake 5 runner task

   // Only needed if you want to fallback to 'normal' environment variables (locally for example)
   let getVarOrDefault name =
       match vault.TryGet name with
       | Some v -> v
       | None -> Environment.environVarOrFail name
   Target.create "Deploy" (fun _ ->
       let token = getVarOrDefault "github_token"
       // Use token to deploy to github

       let apiKey = getVarOrDefault "nugetkey"
       // Use apiKey to deploy to nuget
       ()
   )
val vault : obj
union case Option.Some: Value: 'T -> Option<'T>
val v : obj
union case Option.None: Option<'T>
val getVarOrDefault : name:'a -> 'b
val name : 'a
val v : 'b

Nested types and modules

TypeDescription
Environment
LogDetailResult
LogDetailState
TeamFoundationTraceListener

Implements a TraceListener for TeamCity build servers.

Functions and values

Function or valueDescription
TeamFoundation.createLogDetail(...)
Signature: id:Guid -> parentId:Guid option -> typ:string -> name:string -> order:int -> message:string -> unit
TeamFoundation.defaultTraceListener
Signature: ITraceListener
TeamFoundation.detect()
Signature: unit -> bool
TeamFoundation.install(force)
Signature: force:bool -> unit
TeamFoundation.Installer
Signature: BuildServerInstaller
TeamFoundation.logDetailRaw(...)
Signature: id:Guid -> parentId:Guid option -> typ:string option -> name:string option -> order:int option -> startTime:DateTime option -> finishTime:DateTime option -> progress:int option -> state:LogDetailState option -> result:LogDetailResult option -> message:string -> unit
TeamFoundation.logIssue(...)
Signature: isWarning:bool -> sourcePath:string option -> lineNumber:string option -> columnNumber:string option -> code:string option -> message:string -> unit
TeamFoundation.publishArtifact(...)
Signature: artifactFolder:string -> artifactName:string option -> path:string -> unit
TeamFoundation.publishTests(...)
Signature: runnerType:string -> resultsFiles:seq<string> -> mergeResults:bool -> platform:string -> config:string -> runTitle:string -> publishRunAttachments:bool -> unit
TeamFoundation.seqToPropValue(args)
Signature: args:seq<string> -> string
TeamFoundation.setBuildNumber(number)
Signature: number:string -> unit
TeamFoundation.setBuildState(...)
Signature: state:string -> message:string -> unit
TeamFoundation.setLogDetailFinished(...)
Signature: id:Guid -> result:LogDetailResult -> unit
TeamFoundation.setLogDetailProgress(...)
Signature: id:Guid -> progress:int -> unit
TeamFoundation.setVariable(...)
Signature: variableName:string -> value:string -> unit
TeamFoundation.toList t o
Signature: t:'?16680 -> o:'?16681 option -> ('?16680 * '?16681) list
Type parameters: '?16680, '?16681
TeamFoundation.toType t o
Signature: t:'?16677 -> o:'?16678 option -> ('?16677 * '?16678) option
Type parameters: '?16677, '?16678
TeamFoundation.uploadFile(path)
Signature: path:string -> unit
TeamFoundation.variables
Signature: Vault

Access (secret) build variables

TeamFoundation.write(...)
Signature: action:string -> properties:seq<string * string> -> message:string -> unit