作为发布的一部分,您如何将文件发布回 VSTS Release Management? [英] How do you publish files back to VSTS Release Management as part of a release?

查看:20
本文介绍了作为发布的一部分,您如何将文件发布回 VSTS Release Management?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试上传由 3rd 方 exe 在部署期间创建的日志文件,并将其包含在我的部署结果中,如果可能的话,在单独的选项卡上.

我尝试使用发布工件构建任务,但这仅适用于构建而非发布.

我尝试记录任务,但 ##vso[build.uploadlog] 似乎也适用于构建,因为它抱怨为构建找到容器.

解决方案

版本管理没有用于构建工件的容器,这就是您看到此错误消息的原因.

您可以尝试执行以下任务:

Write-host "##vso[task.uploadfile]"

<块引用>

查看和下载与发布相关的附件

您想在以下时间上传其他日志或诊断或图像吗?在发布中运行任务?此功能使用户可以上传部署期间的其他文件.要上传新文件,请使用在您的脚本中使用以下代理命令:

写主机##vso[task.uploadfile]"

该文件随后可作为发布日志的一部分使用.当你下载与发布相关的所有日志,您将能够也检索此文件.

您还可以在发布定义中添加一个 powershell 脚本任务来读取日志文件并将其输出到控制台.然后,您将在日志"选项卡 powershell 脚本步骤中看到日志文件的内容.您也可以单击以 zip 格式下载所有日志"来下载日志.

I'm trying to upload log files created by a 3rd party exe during a deployment and including it in the results of my deployment, on a separate tab if possible.

I tried using the publish artifact build tasks but that only works for build not release.

I tried logging tasks but ##vso[build.uploadlog]<local file path> seems to be for builds as well since it complains about finding a container for the build.

解决方案

Release management does not have a container for build artifacts, that's why you see this error message.

You can try with following task:

Write-host "##vso[task.uploadfile]<filename>"

View and download attachments associated with releases

Would you like to upload additional logs or diagnostics or images when running tasks in a release? This feature enables users to upload additional files during deployments. To upload a new file, use the following agent command in your script:

Write-host "##vso[task.uploadfile]"

The file is then available as part of the release logs. When you download all the logs associated with the release, you will be able to retrieve this file as well.

You can also add a powershell script task in your release definition to read the log files and output it to the console. Then you will be see the content of the log files from "Logs" tab powershell script step. And you can also click "Download all logs as zip" to download the logs.

这篇关于作为发布的一部分,您如何将文件发布回 VSTS Release Management?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆