[英]Is there a way to translate a yaml build pipeline to a release pipeline using Azure Devops?
In my build pipeline I am running Pester tests and reporting to the output folder.在我的构建管道中,我正在运行 Pester 测试并向 output 文件夹报告。 During release I want to run these and only go to the next stage (deploy) if all tests pass.
在发布期间,如果所有测试都通过,我想运行这些并且只有 go 到下一阶段(部署)。 I am not concerned about the results, I just want to make sure that they all pass.
我不关心结果,我只想确保它们都通过。 I have tried to 'copy' my existing yaml file using the GUI however not sure of the best way to do this and variable scope.
我曾尝试使用 GUI“复制”我现有的 yaml 文件,但不确定执行此操作的最佳方法和变量 scope。 Is it possible to translate a build pipeline directly to an Azure release pipeline in Azure Devops and if so, what is the best approach for doing this?
是否可以将构建管道直接转换为 Azure Devops 中的 Azure 发布管道,如果可以,最好的方法是什么?
I tried to translate it to json however i had an undefined
error when I tried to import the json pipeline.我尝试将其转换为 json 但是当我尝试导入 json 管道时出现
undefined
的错误。 I should also add that I can't see a solution by looking at the preview features for this.我还应该补充一点,通过查看此预览功能我看不到解决方案。
I am afraid it is not possible to translate a build pipeline directly to an Azure release pipeline.恐怕不可能将构建管道直接转换为 Azure 发布管道。
You need to manually add the same tasks which are in the build pipeline to the release stage.您需要手动将构建管道中的相同任务添加到发布阶段。 I believe it is not a complex work to create a stage with the same tasks in the release pipeline.
我相信在发布管道中创建一个具有相同任务的阶段并不是一项复杂的工作。 You just need to add each tasks with the same configurations(copy and paste mostly).
您只需要添加具有相同配置的每个任务(主要是复制和粘贴)。 And create the same variables in
Variables
tab.并在
Variables
选项卡中创建相同的变量。 Check document about classic CD release pipeline .查看有关经典 CD 发布管道的文档。
There is another workaround using multiple stages yaml pipeline instead of classic release pipepline.还有另一种使用多阶段 yaml 管道而不是经典发布管道的解决方法。
With multiple stage yaml pipeline.具有多级 yaml 流水线。 You can just easily move your build yaml content in a stage.
您可以轻松地将您的构建 yaml 内容移动到一个阶段。 Check here for more information.
在这里查看更多信息。 See below:
见下文:
trigger: none
stages:
- stage: Test
jobs:
- job: Pester tests
pool:
vmImage: windows-latest
steps:
..
- stage: Deploy
jobs:
- job: DeployJob
pool:
vmImage: windows-latest
steps:
..
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.