简体   繁体   English

AzureDevOps:从 YAML 触发发布管道的任务

[英]AzureDevOps: A task to trigger a release pipeline from YAML

We have a classic release pipeline that we'd like to be able to trigger from a YAML build pipeline under certain conditions, these conditions aren't always going to be ones we can define using the existing CI trigger that can be defined for a release pipelines.我们有一个经典的发布管道,我们希望能够在某些条件下从 YAML 构建管道触发,这些条件并不总是我们可以使用可以为发布定义的现有 CI 触发器定义的条件管道。 We'd also prefer not to use a multi-stage pipeline as the access controls for the release pipeline wouldn't be easy to replicate for YAML files.我们也不想使用多级管道,因为对于 YAML 文件,发布管道的访问控制不容易复制。

With that in mind is there a task that can be used in a YAML build pipeline in order to "manually" trigger a classic release pipeline?考虑到这一点,是否可以在 YAML 构建管道中使用任务以“手动”触发经典发布管道? This obviously could be achieved via the Azure DevOps API but it would be a lot easier if a task was available.这显然可以通过 Azure DevOps API 来实现,但如果有可用的任务会容易得多。

Based on your requirement, there is no built-in task can trigger release pipeline in Build Pipeline.根据您的要求,Build Pipeline 中没有内置任务可以触发发布管道。

I suggest that you can use the Release Orchestrator task from Release Orchestrator .我建议您可以使用 Release Orchestrator 中的Release Orchestrator 任务。

Then you can use the task in YAML pipeline to trigger the release pipeline.然后可以使用 YAML 管道中的任务来触发发布管道。

For example:例如:

- task: releaseorchestrator@2
  displayName: 'Release Orchestrator'
  inputs:
    projectName: 123
    definitionName: 'New release pipeline'
    definitionStage: 'Stage 1'
    artifactVersion: test
    artifactTag: 1

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

相关问题 AzureDevOps - 发布管道中的缓存任务 - AzureDevOps - Cache Task in Release Pipeline yaml 发布管道的触发器 - Trigger for yaml release pipeline 使用构建/发布管道任务将更改从 AzureDevOps git 存储库上传到私有 TFS 服务器 - Upload changes from AzureDevOps git repo to private TFS server using Build/Release pipeline task 发布管道中的 FileTransform 任务不会更新值 - AzureDevOps - FileTransform Task in release pipeline doesn't update the value - AzureDevOps YAML 发布管道 - 触发新的通用包? - YAML Release pipeline - Trigger on new Universal Package? 在 Azure DevOps 中从构建 (CI) 管道 YAML 文件触发发布 (CD) 管道 - Trigger a Release (CD) pipeline from Build (CI) pipeline YAML file in Azure DevOps 具有多个工件的 AzureDevOps 发布管道 - AzureDevOps Release pipeline with multiple artifacts 如何从 AzureDevOps 发布管道中的特定分支下载代码 - How to download code from a particular branch in AzureDevOps release pipeline 如何从构建到发布管道获取 TFS/AzureDevOps 中的变量值? - How to get the variable value in TFS/AzureDevOps from Build to Release Pipeline? AzureFileCopy 任务在 YAML 管道中失败 - 在发布管道中工作 - AzureFileCopy task failing in YAML pipeline - works in Release pipeline
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM