Skip to content

BuildTasks Task YAML

rfennell edited this page Dec 22, 2022 · 11 revisions

Build Updating Tasks

The 'Build Updating Tasks' package contains the following tasks. The table show the possible variables that can be used in YAML Azure DevOps Pipeline configurations

BuildRetensionTask V3

Set Retension on a Build

YAML snippet

# Set Retension on a Build
# Description - Set Retension on a Build
- task: BuildRetensionTask@3
  inputs: 
     # Required arguments
     mode: Prime
     usePSCore: False

Arguments

  • Argument: mode
    • Description: Select the builds to update.
    • Type: pickList
    • Required: true
    • Default (if defined): Prime
  • Argument: artifacts
    • Description: A comma separated list of build artifacts
    • Type: string
    • Required: false
    • Default (if defined):
  • Argument: keepForever
    • Description: If true will set the build retension on the build
    • Type: boolean
    • Required: false
    • Default (if defined): True

Advanced

  • Argument: usedefaultcreds
    • Description: If true will use the credentials of the running agent as opposed to access token provided by build service.
    • Type: boolean
    • Required: false
    • Default (if defined): False
  • Argument: usePSCore
    • Description: On a Windows agent, if set will run Pester tests with 'pwsh', if false will use 'PowerShell.exe'. On Non-Windows agents 'pwsh' always used
    • Type: boolean
    • Required: true
    • Default (if defined): False

BuildVariableTask V3

Set variable on a build defintion

YAML snippet

# Set variable on a build defintion
# Description - Set variable on a build defintion
- task: BuildVariableTask@3
  inputs: 
     # Required arguments
     buildmode: Prime
     variable: 
     mode: Manual
     value: 
     usePSCore: False

Arguments

  • Argument: buildmode
    • Description: Select the builds to update (Used in Releases only).
    • Type: pickList
    • Required: true
    • Default (if defined): Prime
  • Argument: artifacts
    • Description: A comma separated list of artifacts
    • Type: string
    • Required: false
    • Default (if defined):
  • Argument: variable
    • Description: The name of the build variable to update
    • Type: string
    • Required: true
    • Default (if defined):
  • Argument: mode
    • Description: Select the mode to operate in.
    • Type: pickList
    • Required: true
    • Default (if defined): Manual
  • Argument: value
    • Description: The value of the build variable to update
    • Type: string
    • Required: true
    • Default (if defined):

Advanced

  • Argument: usedefaultcreds
    • Description: If true will use the credentials of the running agent as opposed to access token provided by build service.
    • Type: boolean
    • Required: false
    • Default (if defined): False
  • Argument: usePSCore
    • Description: On a Windows agent, if set will run Pester tests with 'pwsh', if false will use 'PowerShell.exe'. On Non-Windows agents 'pwsh' always used
    • Type: boolean
    • Required: true
    • Default (if defined): False

GetBuildDefinitionVariableValueTask V3

Get the current value of a specified build defintion variable.

YAML snippet

# Get Build Definition Variable
# Description - Get the current value of a specified build defintion variable.
- task: GetBuildDefinitionVariableValueTask@3
  inputs: 
     # Required arguments
     builddefinitionname: 
     variable: 
     localVariable: 
     usePSCore: False

Arguments

  • Argument: builddefinitionname
    • Description: The friendly name of the build definition containing the variable you wish to read the value of.
    • Type: string
    • Required: true
    • Default (if defined):
  • Argument: variable
    • Description: The name of the variable in the specified definition you wish to get the value of
    • Type: string
    • Required: true
    • Default (if defined):
  • Argument: localVariable
    • Description: The name of the build variable in this definition you wish to use to store the value of the remote variable
    • Type: string
    • Required: true
    • Default (if defined):

Advanced

  • Argument: usedefaultcreds
    • Description: If true will use the credentials of the running agent as opposed to access token provided by build service.
    • Type: boolean
    • Required: false
    • Default (if defined): False
  • Argument: usePSCore
    • Description: On a Windows agent, if set will run Pester tests with 'pwsh', if false will use 'PowerShell.exe'. On Non-Windows agents 'pwsh' always used
    • Type: boolean
    • Required: true
    • Default (if defined): False
Clone this wiki locally