检索VSTS/TFS构建任务名称列表 [英] Retrieve VSTS/TFS Build task name list

查看:84
本文介绍了检索VSTS/TFS构建任务名称列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要从VSTS/TFS构建中检索构建任务名称列表.有内置的方法/库可用来支持此功能吗?

I need to retrieve build task name list from VSTS/TFS build. Is there inbuilt method/library available to support this?

我已经注意到(如下例所示),我们可以在发行版中检索到它.

I have already noted (as below sample) that we can retrieve same in release.

import ReleaseClient = require("ReleaseManagement/Core/RestClient");
var rc= ReleaseClient.getClient(); 

release.environments.forEach(function (env) { 
    rc.getTasks(VSS.getWebContext().project.id, release.id, env.id).then(function(taskList){
    ...............
    ......Some code here
    });
}

推荐答案

BuildDefinition ,其中包含一个build属性,该属性是

The documentation doesn't show a direct function call to retrieve the tasks. However, there is a contract for a BuildDefinition, which contains a build property, which is an array of BuildDefinitionStep, each of which has a task property that contains things like the name of the task and the inputs.

The getDefinition() function should give you back a build definition you can work with.

import RestClient = require("TFS/Build/RestClient");

// Get an instance of the client
var client = RestClient.getClient();
var myDefinition client.getDefinition(1234);

这篇关于检索VSTS/TFS构建任务名称列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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