如何在 Azure Pipelines 拉取请求中重新部署发布?

How to redeploy a release in Azure Pipelines Pull request?

由于其中一项任务中的脚本错误,发布失败:

[error]Exception calling "Substring" with "2" argument(s): "Index and length must refer to a location within the string.

我已经解决了这个问题,当我从构建中发布时,发布成功,但 PR 中的状态仍然是:

*** Release failed

如果我单击失败的版本,我可以重新部署,但它仍然使用与以前相同的脚本。

如何更新 PR 中链接版本的状态?

因为 Re-Deploy 是 运行 没有您的更改的确切版本,您需要再次排队 PR 构建:

之后新的发布会进入队列,状态为成功

If I click on the failed release I can do a redeploy but it's still using the same scripts as before.

这是预期的行为。选项 Redeploy 用于 re-deploy 具有不同定义设置的 相同工件

当我们select Redeploy选项时,我们会注意到Artifacts仍然是我们最后一次发布而不是最新的Artifacts:

因此,如果您想要更新 PR 中链接版本的状态,您可以创建一个新的 PR 以使用您的更改对新构建进行排队,或者您可以 select Queue build 像 Shayki 回答的选项。

希望这对您有所帮助。