【问题标题】:Is there any way to know and get only the log for the stage that had an error on Azure DevOps pipelines using REST API?有什么方法可以知道并仅获取使用 REST API 在 Azure DevOps 管道上出错的阶段的日志?
【发布时间】:2019-10-24 21:27:08
【问题描述】:

我看到有一个 REST 端点可以通过其 ID (https://docs.microsoft.com/en-us/rest/api/azure/devops/build/builds/get%20build%20log?view=azure-devops-rest-5.1) 获取日志

据我所见,每个步骤都有一个日志,最后一个日志包含所有步骤。反应总是这样吗?这是否记录在某个地方,最后一个日志将始终是完整日志?

有没有办法知道在构建失败的阶段获取哪个日志?因为我只需要导致构建失败的那个,而不是全部。

【问题讨论】:

    标签: azure azure-devops azure-pipelines azure-rest-api


    【解决方案1】:

    没有,目前在 Azure DevOps Service 中没有这种方式可以实现你所需要的。

    And from what I see there's a log for each step and then the last log contains all steps. Is this always how the response will be?

    还有一个参数叫做 startLine 和 endLine,指定它们,你可以获取整个构建日志的一部分。但这在您的场景中没有用。

    恐怕您必须下载完整日志或get the task log of a release

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-03-25
      • 2021-03-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-01-27
      • 1970-01-01
      相关资源
      最近更新 更多