在 Azure Devops 中复制发布管道所有阶段的更改

Replicate the changes in all stages of a release pipeline in Azure Devops

我有一个多阶段发布管道,它有大约 15 个阶段用于不同的环境。如果我对一个阶段中的其中一个步骤进行了更改,我必须手动将其复制到每个阶段。有没有办法可以选择多个阶段并进行更改?

您可以为此使用任务组:

A task group allows you to encapsulate a sequence of tasks, already defined in a build or a release pipeline, into a single reusable task that can be added to a build or release pipeline, just like any other task. You can choose to extract the parameters from the encapsulated tasks as configuration variables, and abstract the rest of the task information.

这将允许您创建一个模板并对其进行修改,它会在使用它的任何地方进行修改。

https://docs.microsoft.com/en-us/azure/devops/pipelines/library/task-groups?view=azure-devops

关于这个问题,早前有用户反馈。您可以在我们的开发者社区论坛上参考这个用户的声音 (Manage multi-stage release pipeline) 关于同样的问题。

一种方法是删除之前的阶段,然后克隆修改后的阶段,但我认为这不是您想要的,因为发布历史记录丢失并且重新克隆每个更改是乏味的。

因此,同意 4c74356b41,如果您想要一种方法可以轻松地将多个阶段插入发布管道(保持定义一致)并使这些阶段全部可用一次更新,使用 task groups 是一个很好的解决方案。您可以将所有任务添加到一个任务组,然后仅在您的阶段中使用该任务组。如果您对任务组进行更改,则使用该任务组的所有阶段也应更新。

如果任务组不满足您的需求,您可以投票给该建议票并在那里分享您的评论,将您的具体需求留在 comments.The 产品团队会在他们查看时提供更新。