FAKE - F# Make - A DSL for build tasks and more FAKE
6.1.3

Lookig for older versions of the documentation, pre FAKE v6? See 

v5.fake.build

TeamFoundation Module

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. This module does not provide any special APIs please use FAKE APIs and they should integrate into this CI server. If some integration is not working as expected or you have features you would like to use directly please open an issue.

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

Example implementation (supports runner and vault tasks)


        // 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
            ()
        )

Types

Type Description

BuildReason

Defined the supported build reasons that cause the build to run.

Environment

Exported environment variables during build. See the official documentation for details.

Functions and values

Function or value Description

TeamFoundation.logIssue isWarning sourcePath lineNumber columnNumber code message

Full Usage: TeamFoundation.logIssue isWarning sourcePath lineNumber columnNumber code message

Parameters:
    isWarning : bool
    sourcePath : string option
    lineNumber : string option
    columnNumber : string option
    code : string option
    message : string

Set the task.logissue with given data

isWarning : bool
sourcePath : string option
lineNumber : string option
columnNumber : string option
code : string option
message : string

TeamFoundation.setBuildState state message

Full Usage: TeamFoundation.setBuildState state message

Parameters:
    state : string
    message : string

Set the task.complete to given state and message The build state The build state resulting message

state : string
message : string

TeamFoundation.setLogDetailProgress id progress

Full Usage: TeamFoundation.setLogDetailProgress id progress

Parameters:
    id : Guid
    progress : int

Log a message with in progress details

id : Guid
progress : int

TeamFoundation.setVariable variableName value

Full Usage: TeamFoundation.setVariable variableName value

Parameters:
    variableName : string - The name of the variable to set
    value : string - The value of the variable to set

Set task.setvariable with given name and value

variableName : string

The name of the variable to set

value : string

The value of the variable to set

TeamFoundation.variables

Full Usage: TeamFoundation.variables

Returns: Vault

Access (secret) build variables

Returns: Vault

TeamFoundation.write action properties message

Full Usage: TeamFoundation.write action properties message

Parameters:
    action : string
    properties : seq<string * string>
    message : string

Format and write given message to console with given formatting options

action : string
properties : seq<string * string>
message : string