Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PublishBuildArtifacts: Not useable for single file copy #14984

Closed
snewz opened this issue Jun 21, 2021 · 2 comments
Closed

PublishBuildArtifacts: Not useable for single file copy #14984

snewz opened this issue Jun 21, 2021 · 2 comments

Comments

@snewz
Copy link

snewz commented Jun 21, 2021

Type: Bug

Environment

Azure DevOps Server version: Azure DevOps Server 2020 Update 1
PublishBuildArtifacts version: 1.158.3
Agent version: 2.187.2

Issue Description

The help text of "Path to publish" in PublishBuildArtifacts task says: "The folder or file path to publish."

Actual: When specifying a single file in PublishBuildArtifacts all other subdirectories in source location are copied to destination.
Expected: Only the specified file is copied to destination.

Steps to reproduce:

  1. Create a task:
    image
  2. Run the build

Task logs

==============================================================================
Task         : Publish build artifacts
Description  : Publish build artifacts to Azure Pipelines or a Windows file share
Version      : 1.158.3
Author       : Microsoft Corporation
Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/publish-build-artifacts
==============================================================================
robocopy.exe /E /COPY:DA /NP /R:3 "d:\SoDox\Project\0.0.0.1\latex" "\\SomeServer\Doxygen\ProjName\BuildNumber\API-Documentation.pdf" "refman.pdf"

-------------------------------------------------------------------------------
   ROBOCOPY     ::     Robust File Copy for Windows                              
-------------------------------------------------------------------------------

  Started : Montag, 21. Juni 2021 07:00:42
   Source : d:\SoDox\Project\0.0.0.1\latex\
     Dest : \\SomeServer\Doxygen\ProjName\BuildNumber\API-Documentation.pdf\

    Files : refman.pdf
	    
  Options : /S /E /DCOPY:DA /COPY:DAT /NP /R:3 /W:30 

------------------------------------------------------------------------------

	                   1	d:\SoDox\Project\0.0.0.1\latex\
	    New File  		  702008	refman.pdf
	  New Dir          0	d:\SoDox\Project\0.0.0.1\latex\d0\
	  New Dir          0	d:\SoDox\Project\0.0.0.1\latex\d0\d00\
	  New Dir          0	d:\SoDox\Project\0.0.0.1\latex\d0\d01\
	  New Dir          0	d:\SoDox\Project\0.0.0.1\latex\d0\d02\
	  New Dir          0	d:\SoDox\Project\0.0.0.1\latex\d0\d03\
[...]

Explanation

Due to the hardcoded /E option in Invoke-Robocopy.ps1 single file copy is not performed as expected.

@ghost ghost self-assigned this Jul 12, 2021
@ghost ghost added the awaiting deployment Related changes are waiting for deployment to be completed label Aug 10, 2021
@anatolybolshakov
Copy link
Contributor

Hey @snewz the related fix has been rolled out for this feature - closing this one at the moment. Please let us know if you have any further questions.

@anatolybolshakov anatolybolshakov removed the awaiting deployment Related changes are waiting for deployment to be completed label Sep 24, 2021
@snewz
Copy link
Author

snewz commented Sep 24, 2021

Thanks for the update and the fix :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants