Choco

Contains tasks which allow to call Chocolatey

Nested types and modules

TypeDescription
ChocoInstallParams

The choco install parameter type.

ChocoPackParams

The choco pack parameter type.

ChocoPushParams

The choco push parameter type.

ChocolateyChecksumType
ChocolateyInstallerType

Functions and values

Function or valueDescription
ChocoInstallDefaults
Signature: ChocoInstallParams

The default option set given to choco install.

ChocoPackDefaults
Signature: ChocoPackParams

The default option set given to choco pack.

ChocoPushDefaults
Signature: ChocoPushParams

The default option set given to choco push.

exec args timeout
Signature: args:string -> timeout:TimeSpan -> unit

Call custom choco command

Parameters

  • args - string that will be appendedn to choco.exe call

  • timeout - parrent process maximum completion time

    Sample usage

    Target "ChocoPush" (fun _ ->

    1: 
    2: 
    3: 
    4: 
    5: 
    6: 
    7: 
    8: 
    9: 
    
      let newSpecFile = ...
      let args = 
             new StringBuilder()
             |> append "pack"
             |> append newSpecFile
             |> append "-y"
             |> toText
    
     args |> Choco.CallChoco TimeSpan.FromMinutes 1.
    

    )

val newSpecFile : 'a
val args : obj
install setParams packages
Signature: setParams:(ChocoInstallParams -> ChocoInstallParams) -> packages:string -> unit

Call choco to install a package

Parameters

  • setParams - Function used to manipulate the default choco parameters. See ChocoInstallParams

  • packages - Names of packages, path to packages.config, .nuspec or .nupkg to install

    Sample usage

    Target "ChocoInstall" (fun _ -> "pretzel" |> Choco.Install (fun p -> { p with Version = "0.4.0" }) )

IsAvailable
Signature: bool

True if choco is available (only on windows)

Sample usage

1: 
"Build" =?> ("ChocoInstall", Choco.IsAvailable)
pack(setParams)
Signature: setParams:(ChocoPackParams -> ChocoPackParams) -> unit

Call choco to pack a package and create .nuspec, chocolateyInstall.ps1 and chocolateyUninstall.ps1 if informations are specified

Parameters

  • setParams - Function used to manipulate the default choco parameters. See ChocoPackParams

    Sample usage

    Target "ChocoPack" (fun _ -> Choco.Pack (fun p -> { p with Version = "0.5.0"; ... }) )

packFromTemplate setParams nuspecPath
Signature: setParams:(ChocoPackParams -> ChocoPackParams) -> nuspecPath:string -> unit

Call choco to pack a package

Parameters

  • setParams - Function used to manipulate the default choco parameters. See ChocoPackParams

  • nuspecPath - path to the .nuspec to pack

    Sample usage

    Target "ChocoPack" (fun _ -> "pretzel.nuspec" |> Choco.Pack (fun p -> { p with Version = "0.5.0" }) )

push setParams nupkgPath
Signature: setParams:(ChocoPushParams -> ChocoPushParams) -> nupkgPath:string -> unit

Call choco to push a package

Parameters

  • setParams - Function used to manipulate the default choco parameters. See ChocoPushParams

  • nupkgPath - path to the .nupkg to push

    Sample usage

    Target "ChocoPush" (fun _ -> "pretzel.0.5.0.nupkg" |> Choco.Push (fun p -> { p with ApiKey = "123-123123-123" }) )