以编程方式访问 tfs 构建输出 [英] Programmatically access tfs build output

查看:27
本文介绍了以编程方式访问 tfs 构建输出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试编写一个 powershell 脚本,以允许用户指定 tfs 构建 ID(或变更集 ID)并将构建输出下载到当前目录.我将构建配置为将输出复制到服务器,这意味着只能在该目录中访问最新的构建输出.但是,从 Visual Studio 或 TFS Web Access,我可以将 drop 下载为 .zip 文件.

I'm trying to write a powershell script to allow a user to specify a tfs build id (or alternately a changeset id) and download the build output to the current directory. I have the build configured to copy the output to the server, which means only the most recent build output will be accessible in that directory. However from Visual Studio, or from the TFS Web Access, I can download the drop as a .zip file.

我如何以编程方式访问这个 .zip 文件(在 powershell 中,或者即使我能找出 VB 代码来执行此操作,我也可以将其转换为 powershell 脚本)?我是否在考虑构建输出错误,并且有一种更简单、更明显的方法来处理这个问题?旧版本的构建输出是存储在服务器上的其他地方,还是存储在数据库中?我是否应该以不同的方式配置构建以将每个构建存储在单独的文件夹中,而不是覆盖单个文件夹中的每个构建?

How can I access this .zip file programmatically (either in powershell, or even if I could figure out VB code to do this I can convert it to a powershell script)? Am I thinking about build output wrong, and there's a easier, more obvious way to handle this? Is the build output of the older builds being stored somewhere else on the server, or is it store in the database? Should I be configuring the build differently to store each build in a separate folder rather than overwriting each build in a single folder?

推荐答案

您可以通过正确构造的 URL 访问下载 zip.例如:

You can access the download zip via a properly constructed URL. For example:

https://{AccountName}.visualstudio.com/DefaultCollection/{TeamProject}/_apis/build/builds/{BuildId}/artifacts/drop?%24format=zip

这篇关于以编程方式访问 tfs 构建输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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