title | description | ms.date | monikerRange |
---|---|---|---|
CopyPublishBuildArtifacts@1 - Copy and Publish Build Artifacts v1 task |
CopyPublishBuildArtifacts@1 is deprecated. Use the Copy Files task and the Publish Build Artifacts task instead. |
05/14/2024 |
<=azure-pipelines |
:::moniker range="<=azure-pipelines"
Use this task to copy build artifacts to a staging folder and then publish them to the server or a file share. Files are copied to the $(Build.ArtifactStagingDirectory)
staging folder and then published.
Important
This task is deprecated. We recommend that you use Pipeline Artifacts and the Copy Files task and the Publish Build Artifacts task instead.
:::moniker-end
:::moniker range=">=azure-pipelines-2019"
# Copy and Publish Build Artifacts v1
# CopyPublishBuildArtifacts@1 is deprecated. Use the Copy Files task and the Publish Build Artifacts task instead.
- task: CopyPublishBuildArtifacts@1
inputs:
#CopyRoot: # string. Copy Root.
Contents: # string. Required. Contents.
ArtifactName: # string. Required. Artifact Name.
ArtifactType: # 'Container' | 'FilePath'. Required. Artifact Type.
#TargetPath: '\\my\share\$(Build.DefinitionName)\$(Build.BuildNumber)' # string. Optional. Use when ArtifactType = FilePath. Path. Default: \\my\share\$(Build.DefinitionName)\$(Build.BuildNumber).
:::moniker-end
:::moniker range="<=azure-pipelines"
CopyRoot
- Copy Root
string
.
The folder that contains the files you want to copy. If the folder is empty, the task copies files from the root folder of the repo as though $(Build.SourcesDirectory)
was specified.
If your build produces artifacts outside of the sources directory, specify $(Agent.BuildDirectory)
to copy files from the build agent working directory.
:::moniker-end
:::moniker range="<=azure-pipelines"
Contents
- Contents
string
. Required.
Specifies pattern filters (one on each line) that you want to apply to the list of files to be copied. For example:
**
copies all files in the root folder.**\*
copies all files in the root folder and all files in all sub-folders.**\bin
copies files in any sub-folder namedbin
.
:::moniker-end
:::moniker range="<=azure-pipelines"
ArtifactName
- Artifact Name
string
. Required.
Specifies the name of the artifact to create.
:::moniker-end
:::moniker range="<=azure-pipelines"
ArtifactType
- Artifact Type
string
. Required. Allowed values: Container
(Server), FilePath
(File share).
Specifies whether to store the artifact on TFS/Team Services or to copy it to a file share that must be accessible from the build agent.
:::moniker-end
:::moniker range="<=azure-pipelines"
TargetPath
- Path
string
. Optional. Use when ArtifactType = FilePath
. Default value: \\my\share\$(Build.DefinitionName)\$(Build.BuildNumber)
.
The UNC file path location where the artifact is copied. It must be accessible from the build agent.
:::moniker-end
All tasks have control options in addition to their task inputs. For more information, see Control options and common task properties.
:::moniker range="<=azure-pipelines"
None.
:::moniker-end
Important
This task is deprecated. We recommend that you use Pipeline Artifacts and the Copy Files task and the Publish Build Artifacts task instead.
This task has a couple of known issues:
- Some minimatch patterns don't work.
- It eliminates the most common root path for all paths matched.
You can avoid these issues by instead using the Copy Files task and the Publish Build Artifacts task.
:::moniker range="<=azure-pipelines"
Requirement | Description |
---|---|
Pipeline types | YAML, Classic build |
Runs on | Agent, DeploymentGroup |
Demands | None |
Capabilities | This task does not satisfy any demands for subsequent tasks in the job. |
Command restrictions | Any |
Settable variables | Any |
Agent version | 1.83.0 or greater |
Task category | Utility |
:::moniker-end