File Copier Tasks YAML

Richard Fennell edited this page Oct 25, 2018 · 2 revisions

FileUtilities

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

FileCopyTask

Copies files between locations

YAML snippet

# File Copy with filters
# Description - Copies files between locations
- task: FileCopy
  inputs: 
     # Required arguments
     sourceFolder: 
     targetFolder: 
     include: *
     filter: *

Arguments

  • Argument: sourceFolder
    • Description: The source folders, comma delimited
    • Type: string
    • Required: True
    • Default (if defined):
  • Argument: targetFolder
    • Description: The target folder
    • Type: string
    • Required: True
    • Default (if defined):
  • Argument: include
    • Description: The files types to match, comma delimited
    • Type: string
    • Required: True
    • Default (if defined): *
  • Argument: filter
    • Description: The file pattern to match
    • Type: string
    • Required: True
    • Default (if defined): *

GetArtifactFromUncShareTask

Gets the contents of a remote TFS server build's drop location

YAML snippet

# Get Artifact From UNC Share
# Description - Gets the contents of a remote TFS server build's drop location
- task: GetArtifactFromUncShare
  inputs: 
     # Required arguments
     tfsUri: 
     teamproject: 
     defname: 
     artifactname: 
     localdir: $(SYSTEM.ARTIFACTSDIRECTORY)

Arguments

  • Argument: tfsUri
  • Argument: teamproject
    • Description: The name of the source team project
    • Type: string
    • Required: True
    • Default (if defined):
  • Argument: defname
    • Description: The name of the build definition.
    • Type: string
    • Required: True
    • Default (if defined):
  • Argument: artifactname
    • Description: The name of the build artifact.
    • Type: string
    • Required: True
    • Default (if defined):
  • Argument: buildnumber
    • Description: Number of the build to download (if blank latest complete build used)
    • Type: string
    • Required: False
    • Default (if defined):

Advanced

  • Argument: username
    • Description: User name to access remote server (if blank default creds. used)
    • Type: string
    • Required: False
    • Default (if defined):
  • Argument: password
    • Description: Password to access remote server (if blank default creds. used)
    • Type: string
    • Required: False
    • Default (if defined):
  • Argument: localdir
    • Description: The root directory to store the artifact in, defaults to $(SYSTEM.ARTIFACTSDIRECTORY)
    • Type: string
    • Required: True
    • Default (if defined): $(SYSTEM.ARTIFACTSDIRECTORY)

XmlFileUpdateTask

Update an attribute in an Xml file based on XPath filter

YAML snippet

# Update XML file attribute
# Description - Update an attribute in an Xml file based on XPath filter
- task: XmlFileUpdateTask
  inputs: 
     # Required arguments
     filename: 
     xpath: 
     value: 

Arguments

  • Argument: filename
    • Description: The file to update e.g: $(SYSTEM.ARTIFACTSDIRECTORY)\myfile.dll.config
    • Type: string
    • Required: True
    • Default (if defined):
  • Argument: xpath
    • Description: The Xpath query to select a node e.g: /configuration/appSettings/add[@key='A variable']
    • Type: string
    • Required: True
    • Default (if defined):
  • Argument: attribute
    • Description: The attribute name to update e.g. value (if not set InnerText of node will be updated)
    • Type: string
    • Required: False
    • Default (if defined):
  • Argument: value
    • Description: The new value to set e.g. 'new value'
    • Type: string
    • Required: True
    • Default (if defined):
  • Argument: recurse
    • Description: If true will search for files recursivally, default is true.
    • Type: boolean
    • Required: False
    • Default (if defined): True
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.