简体   繁体   English

使用TFS2018 API检索解决方案

[英]Using TFS2018 api to retrieve solution

使用TFS2018 API是否可以检索与特定内部版本相关的所有解决方案文件?

First, you need to use Get a build api to get the sourceVersion of this build: 首先,您需要使用获取构建 API来获取此构建的sourceVersion

GET http://TFS2018:8080/tfs/DefaultCollection/{project}/_apis/build/builds/{buildId}?api-version=2.0

Then, you have two choices to retrieve all files that the build use: 然后,您有两个选择来检索构建使用的所有文件:

  1. Use tf get command. 使用tf get命令。

  2. Use REST API to download a zip folder for the sources. 使用REST API下载源的zip文件夹。 The api is as below: api如下:

~

GET http://TFS2018:8080/tfs/DefaultCollection/_api/_versioncontrol/itemContentZipped?path={FolderPath}&version={sourceVersion}

Also you may try (for git): 您也可以尝试(对于git):

  • Set "Tag sources on success" for build definition. 为构建定义设置“成功时标记源”。 在此处输入图片说明
  • Get sources with tag through tfs rest api: Get a specific version 通过tfs rest api获取带有标签的源: 获取特定版本

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM