0

At the end of my pipeline I want to copy the bin directly to a network share from which it can be used to deploy.

I see there are two possible task typed that could do this:

  • copy files that makes a task: CopyPublishBuildArtifacts@1; or
  • _ copy and publish build artefacts_ that makes a CopyPublishBuildArtifacts@1.

And this publish is different to dotnet publish?

Which one should I pick and why?

They appear to have identical parameters. What is the @ for?

Richard Barraclough
  • 2,625
  • 3
  • 36
  • 54

1 Answers1

0

Azure pipeline yml: publish or file copy?

The task CopyPublishBuildArtifacts is deprecated. If you're using Team Foundation Server 2017 or newer, we recommend that you use Pipeline Artifacts.

And if you want to know the different between publishbuildartifacts vs publishpipelineartifact, you could check below thread for the details:

What is the difference between Build Artifact and Pipeline Artifact tasks?

And this publish is different to dotnet publish?

The answer is yes. The dotnet publish task is to serve the specific project. Its function is similar to that we choose the Publish option for net core project in Visual Studio.

But we could specify the folder or files to publish for the publishbuildartifacts or publishpipelineartifact task.

Which one should I pick and why?

We recommend to use the publishpipelineartifact task if you just want to copy the bin directly to a network share.

You could check the reason from here:

  • For build artifacts, it's common to copy files to $(Build.ArtifactStagingDirectory) and then use the Publish Build Artifacts task to publish this folder. With the Publish Pipeline Artifact task, you can just publish directly from the path containing the files.
  • By default, the Download Pipeline Artifact task downloads files to $(Pipeline.Workspace). This is the default and recommended path for all types of artifacts.
  • File matching patterns for the Download Build Artifacts task are expected to start with (or match) the artifact name, regardless if a specific artifact was specified or not. In the Download Pipeline Artifact task, patterns should not include the artifact name when an artifact name has already been specified. For more information, see single artifact selection.

What is the @ for?

The role of @ is to specify the version of the task. For example, @1 is to use the version 1.0 of the task.

Leo Liu
  • 71,098
  • 10
  • 114
  • 135