简体   繁体   中英

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. During release I want to run these and only go to the next stage (deploy) if all tests pass. 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. 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?

I tried to translate it to json however i had an undefined error when I tried to import the json pipeline. 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.

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. Check document about classic CD release pipeline .

There is another workaround using multiple stages yaml pipeline instead of classic release pipepline.

With multiple stage yaml pipeline. You can just easily move your build yaml content in a stage. 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:
    ..

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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