本文整理汇总了TypeScript中azure-devops-node-api/BuildApi.IBuildApi.getBuild方法的典型用法代码示例。如果您正苦于以下问题:TypeScript IBuildApi.getBuild方法的具体用法?TypeScript IBuildApi.getBuild怎么用?TypeScript IBuildApi.getBuild使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类azure-devops-node-api/BuildApi.IBuildApi
的用法示例。
在下文中一共展示了IBuildApi.getBuild方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: resolve
return new Promise<boolean>(async (resolve, reject) => {
try {
for (var i = 0; i < artifacts.length; i++) {
var artifact = artifacts[i];
if (parseInt(artifact.definitionReference.definition.id) === build.definition.id) {
// We have found the definition
var artifactBuildId = artifact.definitionReference.version.id;
var artifactBuild = await buildApi.getBuild(parseInt(artifactBuildId), artifact.definitionReference.project.name);
var buildCommitPromise = gitApi.getCommit(build.sourceVersion, build.repository.id, build.project.name);
var artifactCommitPromise = gitApi.getCommit(artifactBuild.sourceVersion, artifactBuild.repository.id, artifactBuild.project.name);
await Promise.all([buildCommitPromise, artifactCommitPromise]).then(function(values) {
var buildCommit = values[0];
var artifactCommit = values[1];
if (buildCommit.author.date > artifactCommit.author.date) {
resolve(true);
} else {
resolve(false);
}
}).catch(reason => {
reject(reason);
});
}
}
resolve(true);
} catch (err) {
reject(err);
}
});
示例2: executeWithRetries
build = await executeWithRetries("getBuild", () => buildApi.getBuild(buildId, projectId), retryLimit).catch((reason) => {
示例3: getBuildFromTargetUrl
export async function getBuildFromTargetUrl(buildApi: IBuildApi, targetUrl: string, project: string): Promise<Build> {
// Extract the build Id
var buildId: number = parseInt(targetUrl.substring((targetUrl.lastIndexOf("/") + 1), targetUrl.length));
return await buildApi.getBuild(buildId, project);
}