【问题标题】:Azure DevOps agent pool used by my pipeline我的管道使用的 Azure DevOps 代理池
【发布时间】:2021-12-28 10:07:49
【问题描述】:

我在 YAML 文件中定义了管道,其中存在以下部分

jobs:
  - displayName: Name X
    pool: pool1

我在运行日志中看到了Agent name: 'agent1'agent1pool1 的一部分)。 到目前为止,一切看起来都不错。但是,当我在命令下运行时(11764 是我的管道的构建之一),我收到:

$ az pipelines runs show --org=${ORG} --project="${PROJECT}" --id 11764 | jq .queue
{
  "id": 9,
  "name": "Azure Pipelines",
  "pool": {
    "id": 9,
    "isHosted": true,
    "name": "Azure Pipelines"
  },
  "url": null
}

问题是。我应该以不同的方式还是在另一个级别上定义池?或者也许有什么我没有考虑到的?

【问题讨论】:

  • 什么是pool1?是 MS 池还是私人池?
  • 在您的管道 yaml 中,作业定义看起来不正确;不应该以-job: NameX 开头吗?
  • pool1 是一个私有池

标签: azure-devops azure-pipelines


【解决方案1】:

根据我的测试,az pipelines runs show 命令将获取在 YAML 管道 UI 上定义的代理池信息(导航到 Triggers -> YAML )但不是在 YAML 中定义的代理池信息。

因此,虽然你的 YAML 中的定义是正确的,但az pipelines runs show 命令的响应仍然是 Microsoft-Hosted Agent Pool。

为缓解此问题,您可以在 YAML Pipline UI 中将代理池更改为 pool1。

【讨论】:

    猜你喜欢
    • 2022-11-12
    • 2021-02-23
    • 1970-01-01
    • 2020-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-11-23
    相关资源
    最近更新 更多