简体   繁体   English

将 Azure DevOps 管道中的阶段配置为手动,而不是自动

[英]Configure a stage in an Azure DevOps pipeline to be manual, not automatic

I have an Azure DevOps pipeline that first builds a Function App and then deploys it through several different stages.我有一个 Azure DevOps 管道,它首先构建一个 Function 应用程序,然后通过几个不同的阶段部署它。 My goal is not have the deployment stages trigger automatically.我的目标不是自动触发部署阶段。

When using releases, I'm able to achieve my goal by defining pre-deployment checks so that deployment to a stage is not triggered automatically.使用发布时,我可以通过定义部署前检查来实现我的目标,这样部署到阶段就不会自动触发。 Since there is no option to make deployment of a stage 'manual after stage', I have to add an artefact filter to the relevant stage and set it to exclude * .由于没有选项可以在“阶段后手动”部署阶段,因此我必须在相关阶段添加一个人工制品过滤器并将其设置为排除*

Unfortunately, stage triggers and artefact filters don't appear to exist for pipelines -不幸的是,管道似乎不存在阶段触发器和伪影过滤器 -

The environments that I can link to deployment stages do include approvals and checks, but these appear to be very limited and of no real use.我可以链接到部署阶段的环境确实包括批准和检查,但这些似乎非常有限并且没有实际用途。

I have attempted to add a manual intervention, but despite the task being available through the pipeline assistant it does not work on a pipeline, only on a release.我试图添加手动干预,但尽管任务可通过管道助手获得,但它不适用于管道,只能在发布时使用。

How can I achieve my goal of manual deployment to stages of a pipeline?如何实现手动部署到管道阶段的目标?

Here is an example of my pipeline.这是我的管道示例。

stages:
- stage: Publish
  displayName: Publish Function App
  jobs:
  - ...
- stage: Dev
  displayName: Deploy Dev
  jobs:
  - ...
- stage: Staging
  displayName: Deploy Staging
  jobs:
  - ...
- stage: Production
  displayName: Deploy Production
  jobs:
  - ...

How can I achieve my goal of manual deployment to stages of a pipeline?如何实现手动部署到管道阶段的目标?

Sorry but as I know manual trigger for yaml pipeline is not available currently.抱歉,但据我所知,yaml 管道的手动触发目前不可用。 This feature request has been submitted to our User Voice forum. 此功能请求已提交到我们的用户语音论坛。 You can vote it and track the issue there, so that you'll get notifications if there's any update.您可以投票并在那里跟踪问题,以便在有任何更新时收到通知。

According to your scenario, have you tried the approvals ?根据您的情况,您是否尝试过批准 If we set the approvals in Environments , the deployment job would stop and wait for manual approvals.如果我们在Environments中设置批准,部署作业将停止并等待手动批准。 The deployment to a stage won't really start until we manually approve that, I think it's also helpful for your scenario.在我们手动批准之前,不会真正开始部署到某个阶段,我认为这对您的方案也有帮助。 Here's one blog which you can refer to.这是一个你可以参考的博客

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM