Azure DevOps, YAML release pipelines? [closed]

梦想的初衷 提交于 2019-11-26 19:40:04

问题


I am following this process to create a YAML build pipeline for a .NET Core Web API project:

https://docs.microsoft.com/en-us/azure/devops/pipelines/get-started-yaml?view=vsts

When it comes to releasing it, I note that the (recently renamed) Azure DevOps doesn't seem to support YAML for defining release pipelines. However, I can see that deployment tasks have been defined eg:

https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/deploy/azure-rm-web-app-deployment?view=vsts

Are we expecting an upgrade to the release pipelines functionality to support YAML and, if so, when?


回答1:


At the time of writing this response the features timeline reflects yaml releases are coming 2018 Q3.

https://docs.microsoft.com/en-us/azure/devops/release-notes/

Update: This has been bumped a few times. Checking the comments below is recommended as folks have been providing updates as they find them.

Update

As per comments, this is now possible: https://devblogs.microsoft.com/devops/whats-new-with-azure-pipelines/. The following is copied and pasted from the article and demonstrates using various stages:

stages:
- stage: Build
  jobs:
  - job: Build
    pool:
      vmImage: 'Ubuntu-16.04'
    continueOnError: true
    steps:
    - script: echo my first build job
- stage: Deploy
  jobs:
    # track deployments on the environment
  - deployment: DeployWeb
    pool:
      vmImage: 'Ubuntu-16.04'
    # creates an environment if it doesn’t exist
    environment: 'smarthotel-dev'
    strategy:
      # default deployment strategy
      runOnce:
        deploy:
          steps:
          - script: echo my first deployment



回答2:


The Product Team is working on it. You can track the update through Release notes.




回答3:


YAML build pipeline creation experience is in preview. (today is 2018-12-04)

YAML for release pipelines seems to be a ways off still: 2019 Q2

Preview features can be enabled from your profile like this:

EDIT: As nullforce points out in comments, this only enables a YAML experience for build pipelines and not release pipelines.

UPDATE (2019-05-16): Following Microsoft's "Build 2019", the full YAML experience for both build and deployment should now be possible in the same YAML pipelines file.




回答4:


I am in the middle of doing something like this right this very moment, but I am using the current REST APIs. What I am doing something similar to what I documented here (How do you import a release definition in VSTS?). Basically I am saving a templated JSON Release Pipeline file into the source code repository with variable placeholders, and a version number embedded. A then have a PowerShell script that is calling the Azure DevOps (that's a long word, I preferred typing VSTS, maybe I'll start typing AD)

  • REST APIs to check of the Release Pipeline exists - works
  • Create if it doesn't exist - works
  • Compare embedded versions and update and if necessary (I'm stuck here, but I'll solve it, returning error that pipeline being updated hasn't changed even though I've changed it.)

I want this to executing during the Build pipeline so that I no longer have to modify lots of similar Release pipelines manually. I would prefer this to be a YAML file as well, but this is what I have today. I hope this helps.




回答5:


Pipelines are made of one or more jobs and may include resources and variables. Jobs are made of one or more steps plus some job-specific data. Steps can be tasks, scripts, or references to external templates. This is reflected in the structure of the YAML file. Please visit here for details



来源:https://stackoverflow.com/questions/52323065/azure-devops-yaml-release-pipelines

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!