【问题标题】:Custom Azure DevOps task has satisfies section but is not satisfying demands自定义 Azure DevOps 任务已满足部分但未满足需求
【发布时间】:2021-06-16 02:01:48
【问题描述】:

我正在尝试在没有将 Maven 直接安装在 ADO 自托管代理上的情况下运行构建。我希望能够为我完成 Maven 安装任务并满足某些构建的需求要求。 (构建有 Maven 需求,但在任务运行之前代理没有安装 Maven。)

在 Maven 安装程序任务中,我有一个满意部分,如下所示:

“satisfies”: [
“maven”
],

Microsoft repo 中有与上述标签相同的任务,但针对不同的软件。请查看这些存储库:

(这个 repo 满足 DotNetCore) https://github.com/microsoft/azure-pipelines-tasks/blob/master/Tasks/DotNetCoreInstallerV1/task.json

(这个 repo 满足 Java 和 JDK) https://github.com/microsoft/azure-pipelines-tasks/blob/master/Tasks/JavaToolInstallerV0/task.json

带有“满足”部分的 Microsoft 任务将满足需求,而我的则不能。

我假设“满足”部分将满足某些管道将具有的需求。这个假设正确吗?或者有谁知道满足部分的用途是什么??

【问题讨论】:

    标签: maven azure-devops task azure-devops-self-hosted-agent


    【解决方案1】:

    我认为需求部分,而不是满足部分,定义了管道的需求。

    这里是来自tasks.schema.json需求的示例代码和描述中说的

    这部分定义了构建代理需要的需求列表 运行此构建任务。

    "demands": {
      "type": "array",
      "description": "Allows you to define a list of demands that a build agent requires to run this build task.",
      "items": {
        "type": "string"
      }
    },
    

    【讨论】:

    • 我认为需求部分列出了任务对代理的要求。但是,我希望满足对代理有需求的任务,并且只需执行任务即可满足需求。 EX: 1) Task requires Maven to be on Agent. 2) Agent does not have Maven installed. 3) Task has satisfies section listing Maven, Task will also install Maven on the agent 4) ADO chooses Agent that does not have Maven and then Task installs Maven satisfying the demand. 希望这是有道理的!
    猜你喜欢
    • 2022-07-02
    • 2017-11-27
    • 2019-05-11
    • 2022-06-17
    • 2018-10-26
    • 2013-01-17
    • 2019-04-03
    • 1970-01-01
    • 2018-08-05
    相关资源
    最近更新 更多