检查Azure中的部署状态

发布于 2025-02-11 08:37:22 字数 568 浏览 1 评论 0原文

我正在使用以下API来从3个管道中获得最新的部署状态(如果有任何版本),然后开始在每个管道中部署。

"https://vsrm.dev.azure.com/ABC/DEF/_apis/release/deployments?definitionId=100&deploymentStatus=inProgress"
"https://vsrm.dev.azure.com/ABC/DEF/_apis/release/deployments?definitionId=101&deploymentStatus=inProgress"
"https://vsrm.dev.azure.com/ABC/DEF/_apis/release/deployments?definitionId=102&deploymentStatus=inProgress"

根据计数,我决定是否在count&gt中进行任何运行。 0。我正在研究逻辑,如果其他管道中的任何部署在其中进行,那么部署应该等待其他部署完成,因为所有部署都在部署到同一环境中。

状态检查任务也正在进行中,因此如果任务正在运行,它将无限循环等待。有什么方法可以实现这一目标。

I am using below API to get the latest deployment status(If any release going on) from 3 pipeline's before starting an deployment in each pipeline.

"https://vsrm.dev.azure.com/ABC/DEF/_apis/release/deployments?definitionId=100&deploymentStatus=inProgress"
"https://vsrm.dev.azure.com/ABC/DEF/_apis/release/deployments?definitionId=101&deploymentStatus=inProgress"
"https://vsrm.dev.azure.com/ABC/DEF/_apis/release/deployments?definitionId=102&deploymentStatus=inProgress"

Based on count I am deciding whether the any run going on in pipeline if count > 0. I am working on logic where if any deployment going on in other pipeline then Deployment should wait for other to finish since all are deploying to same environment.

The status checking task also is in progress so it is going to infinite loop to wait if task is running. Is there any way to achieve this.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

香草可樂 2025-02-18 08:37:22

根据您的要求,您需要检查发布管道的部署状态。

为了减轻您的问题,我建议您可以为每个发行管道添加一个额外的阶段,然后您可以在新阶段添加检查部署状态。

请参阅我的步骤:

  1. 在部署阶段之前添加新阶段,并添加状态检查步骤。

  1. 在REST API中,您可以在URL中添加 definityenvironmentID 参数以检查指定阶段。

例如:

 "https://vsrm.dev.azure.com/ABC/DEF/_apis/release/deployments?definitionId=102&deploymentStatus=inProgress&definitionEnvironmentId=xx"

在这种情况下,您可以将检查状态步骤和部署过程分开。

有关更多详细信息,您可以参考以下文档:部署 - 列表

Based on your requirement, you need to check the Deployment status of the release pipeline.

To alleviate your issue, I suggest that you can add an additional stage to each release pipeline and then you can add the check deployment status in the new stage.

Refer to my steps:

  1. Add a new stage before the deployment stage and add the status check steps.

enter image description here

  1. In the Rest API, you can add the definitionEnvironmentId parameter in the URL to check the specify stage.

For example:

 "https://vsrm.dev.azure.com/ABC/DEF/_apis/release/deployments?definitionId=102&deploymentStatus=inProgress&definitionEnvironmentId=xx"

In this case, you can separate the check status step and the deployment process.

For more detailed info, you can refer to this doc: Deployments - List

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文