【问题标题】:Can I automate Continuous Deployment trigger for Release Definition activation with the Azure Devops REST API 6.0?我可以使用 Azure Devops REST API 6.0 自动激活持续部署触发器以激活发布定义吗?
【发布时间】:2021-09-19 15:19:02
【问题描述】:

我使用 Azure DevOps REST 6.0 API 从 PowerShell 脚本自动创建和设置 Azure DevOps 项目。 我只剩下一步可以完全自动化配置...这是在发布管道的定义中激活持续部署触发器...

这是一个可以自动化的步骤吗? API有什么办法吗?

谢谢你的回答????

【问题讨论】:

    标签: azure azure-devops automation


    【解决方案1】:

    如果您在通过 UI 启用持续部署后查看历史选项卡,您将看到需要提供的 JSON:

        "triggers": [
            {
                "triggerType": 1,
                "triggerConditions": null,
                "artifactAlias": "_MyArtifact"
            }
        ],
    

    使用分支过滤器:

      "triggers": [
        {
          "artifactAlias": "_MyArtifact",
          "triggerConditions": [
            {
              "sourceBranch": "main",
              "tags": [],
              "tagFilter": null,
              "useBuildDefinitionBranch": false,
              "createReleaseOnBuildTagging": false
            }
          ],
          "triggerType": "artifactSource"
        }
      ],
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-08-22
      • 2012-08-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多