在 Azure DevOps 经典管道中,您可以拥有一个用于创建工件的构建管道和一个用于部署它的发布管道。这意味着可以部署任何存储的现有工件,只需启动发布管道并选择工件的版本(典型用法:将当前部署的工件回滚到以前的版本)
如何在多阶段管道中实现这一点?任何方式只启动部署阶段选择要部署的工件?
问候
在 Azure DevOps 经典管道中,您可以拥有一个用于创建工件的构建管道和一个用于部署它的发布管道。这意味着可以部署任何存储的现有工件,只需启动发布管道并选择工件的版本(典型用法:将当前部署的工件回滚到以前的版本)
如何在多阶段管道中实现这一点?任何方式只启动部署阶段选择要部署的工件?
问候
How this can be achieved in Multi-Stage pipeline? Any way of launching only the deployment stage selecting the artifact to be deployed?
Indeed, this is very convenient to choose prexisting artifact based on actual demands, but what you want does not supported in Multi-Stage pipeline until now.
This request already reported to the MS product team:
Select artifacts in YAML release pipeline
This feature have been added in the last sprint:
Pipeline resource version picker in the create run dialogue
However, as I test, it seems this feature has not been deployed in all regions:
If it not deployed in your region, you could try to use the task Download Pipeline Artifacts task with the runId
input:
- task: DownloadPipelineArtifact@2
inputs:
source: 'specific'
artifact: 'drop'
path: $(Build.SourcesDirectory)/bin
project: 'AndroidBuild'
pipeline: 12
runVersion: 'specific'
runId: $(buildid)
Then use pass queue variable buildid
when we queue the build:
Hope this helps.
这可以通过有两个管道来完成。一个用于构建的管道,您的管道在其中生成工件并为您的发布阶段创建另一个管道。在发布管道中,您可以将资源设置为指向另一个构建或管道。您可以在其中使用之前生成的工件(包括旧版本)到部署阶段。
请参阅: YAML 资源
您的发布 YAML 管道可以指定它需要的资源。您可以指定现有构建或其他管道。
resources:
pipelines:
- pipeline: SmartHotel-resource # identifier for the resource (used in pipeline resource variables)
source: SmartHotel-CI # name of the pipeline that produces an artifact
但是,将它们分开只会导致移动开销和维护。