当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript IBuildApi.getBuild方法代码示例

本文整理汇总了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);
        }
    });
开发者ID:gregpakes,项目名称:ArtifactVariables,代码行数:31,代码来源:UtilFunctions.ts

示例2: executeWithRetries

 build = await executeWithRetries("getBuild", () => buildApi.getBuild(buildId, projectId), retryLimit).catch((reason) => {
开发者ID:Microsoft,项目名称:vsts-tasks,代码行数:1,代码来源:main.ts

示例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);
}
开发者ID:gregpakes,项目名称:ArtifactVariables,代码行数:5,代码来源:UtilFunctions.ts


注:本文中的azure-devops-node-api/BuildApi.IBuildApi.getBuild方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。