sanjai
sanjai

Reputation: 116

How to download build artifact to local folder

I'm using Azure Pipeline for CI, the same is configured to self hosted agent.

Question is I want to Download the build file to the local folder of self hosted agent (eg: c:\agent\buildFolder)

Can you guide me on the above question.

Thanks in advance.

Upvotes: 0

Views: 447

Answers (1)

Joy Wang
Joy Wang

Reputation: 42133

In this case, if you are running the pipeline in the self-hosted agent, and you want to download the file from c:\agent\buildFolder to another local folder, you can simply use the Copy Files task, just specify the Source Folder, contents, Target Folder you want.

# Copy files
# Copy files from a source folder to a target folder using patterns matching file paths (not folder paths)
- task: CopyFiles@2
  inputs:
    #sourceFolder: # Optional
    #contents: '**' 
    targetFolder: 
    #cleanTargetFolder: false # Optional
    #overWrite: false # Optional
    #flattenFolders: false # Optional
    #preserveTimestamp: false # Optional
    #retryCount: 0 # Optional
    #ignoreMakeDirErrors: false # Optional

Upvotes: 3

Related Questions