在Azure Pipelines阶段(YAML)上手动触发 [英] Manual Trigger on Azure Pipelines Stages (YAML)

查看:131
本文介绍了在Azure Pipelines阶段(YAML)上手动触发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Azure Pipelines YAML格式设置管道.我创建了3个阶段:构建,分段和生产.顾名思义,Build阶段将构建项目并发布构建工件.过渡阶段部署到过渡环境,生产阶段部署到生产环境.

I'm setting up a pipeline using Azure Pipelines YAML format. I have created 3 stages: Build, Staging, and Production. As the names suggest, the Build stage builds the project and publishes the build artifacts. The Staging stage deploys to the Staging environment and the Production stage deploys to the Production environment.

在我的项目的环境"部分中,我添加了对生产环境的检查,以便可以在上线之前批准部署.

In the Environments section of my project, I have added a check for the Production environment so that I can approve the deployment before going live.

我的管道的工作方式是在构建阶段完成后,自动触发登台"阶段和生产"阶段.我对此不满意的是,当开发人员将其代码部署到Staging时,他们需要几天的时间在Staging上对其进行测试,然后才能将其代码推送到Production.因此,直到那时,我的管道一直在运行并等待我的批准.左上角的微调框不断旋转,并且"Duration"字段持续通过.

The way that my pipeline works is that both Staging and Production stages are triggered automatically after the Build stage is finished. What I don't like about this is that when developers deploy their code to Staging, they need a couple of days to test it on Staging before pushing their code to Production. So, until then, my pipeline keeps running and waiting for my approval. The spinner at the top-left corner keeps spinning and the "Duration" field keeps passing.

有什么方法可以使开发人员随时准备触发生产阶段,而不是通过构建阶段触发生产阶段?

Is there any ways that develpers manually trigger the Production stage whenever they are ready instead of the Build stage triggering it?

推荐答案

yaml管道中的手动阶段当前不可用.此功能请求已提交给Microsoft.您可以投票或提交新的投票.

Manual stages in yaml pipeline is not available currently. This feature request has been submitted to Microsoft. You can go and vote it up or submit a new one.

有一些解决方法可以实现此目的.

There are workarounds to achieve this.

您可以将您的登台制作阶段移动到Classic Web UI Release Pipeline. Web UI发布管道中提供了手动触发阶段.请在此处进行检查,以了解更多信息信息.

You can move your staging and production stages to Classic Web UI Release Pipeline. Manually trigger a stage is available in Web UI Release pipeline. Please check here for more information.

另一种实现此目的的方法是将yaml管道分成两个yaml管道(阶段管道和生产管道).并禁用生产管道的CI构建(在管道编辑页面中,单击右上角的3dots并选择触发器.请参阅下面的图片).

Another way to achieve this is to separate your yaml pipeline into two yaml pipelines(stage pipeline and production pipeline). And disable CI build for production pipeline( in the pipeline edit page, click on the 3dots on the top right corner and choose triggers. Please refer to below pics).

以便您可以在Developer完成测试后手动运行生产管道.

So that you can manually run production pipeline after Developer done with their tests.

这篇关于在Azure Pipelines阶段(YAML)上手动触发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆