如何最好地从VSTS下载源文件? [英] How best to download source files from VSTS?

查看:59
本文介绍了如何最好地从VSTS下载源文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要定期从VSTS帐户(服务器工作区)中下载特定项目的完整最新代码集,到文件服务器上的文件夹中,以进行只读归档.

I need to regularly download a complete set of latest code for a particular project from a VSTS account (server workspace), to a folder on a file server for readonly archiving.

当前,我登录到Web门户,并为所选项目单击下载为ZIP 并将其保存到文件服务器.

Currently I log on to the web portal and click Download as ZIP for the selected project and save this to the file server.

但是我想要一种更自动化的方法,最好是我可以安排从文件服务器本身运行的某种方式,该服务器无需安装Visual Studio或为在线帐户缓存凭据.

But I'd like a more automated way, preferably something I can schedule to run from the file server itself which won't have Visual Studio installed or cached credentials for the online account.

以下任何解决方案都可以:

Any of the following soluions would be ok:

  • 用于将最新代码下载为zip文件的永久URL
  • REST URL 获取所有最新文件
  • 连接到VSTS的命令行工具 帐户,并将特定项目的所有最新文件 下载到指定的本地文件夹,而不是默认的本地文件夹
  • A permanent URL to download the latest code as a zip file
  • A REST URL to get all latest files
  • A command line tool to connect to the VSTS account and download all latest files for a particular project to a specified local folder, not the default local folder

很好玩:

  • 下载为ZIP或文件递归文件夹的选项
  • 将文件修改日期设置为签入时间
  • 从下载的文件中删除源代码管理绑定信息
  • 在命令行中提供用户凭据,而不假定使用计算机上的默认缓存凭据

推荐答案

您可以在Visual Studio,Eclipse或命令行中使用我们的工具,将源代码的本地副本保留在您的机器.

You could use our tools in Visual Studio, Eclipse, or from the command line to keep a local copy of your source code on your machine.

更多详细信息,请参阅官方教程:

More details please refer official tutorial: Download (get) files from the Server

此外,如果您想以zip格式下载代码,则

Also, if you want to download your code as a zip:

您可以单击任何省略号找到包含Download as Zip选项的菜单.

You can click on any ellipsis to find the menu which contains Download as Zip option.

如果您想要自动化的方式,建议您使用构建管道.您可以在构建定义中禁用默认的获取源步骤.并使用您自己的powershell脚本将源/拉文件获取到工作区.如何操作,请遵循:

If you want a automated way, suggest you use the build pipeline. You could disable the default get source steps in the build definition. And use your own powershell script to do the get source/pull files to the workspace. How to, please follow: Is it able to ignore/disable the first step Get source in vNext Build?

如果不是您正在使用的计算机,这将在您的构建代理中下载文件.您可以结合存档文件& Windows机器文件复制任务,然后在构建定义中选择计划的触发器.

This will download files in your build agent, if it's not the machine you are working on. You could combine Archive Files & Windows Machine File Copy task and select Scheduled trigger in your build definition.

这篇关于如何最好地从VSTS下载源文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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