[英]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.