Publish Build Artifacts does not work on release definition
See original GitHub issueThe utility task Publish Build Artifacts doesn’t appear to work correctly. I’ve created a simple repro scenario to demonstrate. The cause I can initially think of is that this is running via the on-prem Agent, but I don’t think that should matter because it just downloads files locally then uploads/publishes the local artifacts back to the server.
The ultimate error I get is:
2017-01-10T19:32:05.2129999Z ##[error]Unable to process command '##vso[artifact.upload artifacttype=container;artifactname=MyLogsArtifactName;containerfolder=MyLogsArtifactName;localpath=C:\agent\_work\r2\a\UploadLogFiles\MyLogs;]C:\agent\_work\r2\a\UploadLogFiles\MyLogs' successfully. Please reference documentaion (http://go.microsoft.com/fwlink/?LinkId=817296)
2017-01-10T19:32:05.2159990Z ##[error]Value cannot be null.
Steps to reproduce
Initial Setup
Create C:\Temp\VSTS directory and add two dummy files “Test2File.txt” and “TestUploadFile.log”.
These represent misc logs that may be collected during a build.
Build Definition
Create a single PowerShell build step with “Type=Inline Script” and use the following code (see screenshot too):
Write-Host "##vso[artifact.upload containerfolder=MyLogs;artifactname=MyLogs;]C:\TEMP\VSTS\Test2File.txt"
Write-Host "##vso[artifact.upload containerfolder=MyLogs;artifactname=MyLogs;]C:\TEMP\VSTS\TestUploadFile.log"
Write-Output "Uploaded 2 files..."
Run this build! And explore/verify the files were uploaded correctly (see screenshot).
Release Definition
Create a new, simple release definition according to the following screenshot, where you select the “Path to Publish” as the directory from the build step. Choose “Server” for artifact type.
Run this release and you’ll receive something similar to the error below:
2017-01-10T19:32:04.9330002Z ##[section]Starting: Publish Artifact: MyLogsArtifactName
2017-01-10T19:32:04.9599998Z ==============================================================================
2017-01-10T19:32:04.9599998Z Task : Publish Build Artifacts
2017-01-10T19:32:04.9599998Z Description : Publish Build artifacts to the server or a file share
2017-01-10T19:32:04.9599998Z Version : 1.0.39
2017-01-10T19:32:04.9599998Z Author : Microsoft Corporation
2017-01-10T19:32:04.9599998Z Help : [More Information](https://go.microsoft.com/fwlink/?LinkID=708390)
2017-01-10T19:32:04.9599998Z ==============================================================================
2017-01-10T19:32:05.2129999Z ##[error]Unable to process command '##vso[artifact.upload artifacttype=container;artifactname=MyLogsArtifactName;containerfolder=MyLogsArtifactName;localpath=C:\agent\_work\r2\a\UploadLogFiles\MyLogs;]C:\agent\_work\r2\a\UploadLogFiles\MyLogs' successfully. Please reference documentaion (http://go.microsoft.com/fwlink/?LinkId=817296)
2017-01-10T19:32:05.2159990Z ##[error]Value cannot be null.
Parameter name: containerId
2017-01-10T19:32:05.2770001Z ##[section]Finishing: Publish Artifact: MyLogsArtifactName
Issue Analytics
- State:
- Created 7 years ago
- Comments:26 (10 by maintainers)
That’s right. We currently don’t support publishing artifacts from a release.
##vso[task.uploadfile] can be used to upload files to release. We don’t have plans to support uploading folder/artifacts from release in near future.