4
votes

I've been looking into Azure DevOps and I'm puzzled by something: Microsoft seem to be strongly recommending the use of YAML pipelines instead of classic ones; fair enough, but they need to replace all the functionality that was in classi​c pipelines. How am I meant to replace the "release pipeline" functionality with YAML pipelines?

So for example, with classic release pipelines, I could setup a pipeline to deploy to production that had a manual trigger (see 'Manually by a user'):

https://docs.microsoft.com/en-us/azure/devops/pipelines/release/triggers?view=azure-devops#pull-request-triggers

What's the YAML pipeline equivalent to this? I obviously don't want a trigger that automatically deploys to production - I always want that deployment to be initiated strictly manually - but the help article doesn't seem to provide any YAML alternative.

2
You're looking for multi-stage pipelines and deployment jobs (docs.microsoft.com/en-us/azure/devops/pipelines/process/…).Daniel Mann

2 Answers

2
votes

As Daniel comments above, Yaml pipeline supports multi-stage yaml pipelines for CD. You can check Azure DevOps Pipelines – Multi-Stage Pipelines and YAML for Continuous Delivery for more details.

Azure devops yaml multi-stage pipeline and classic release pipeline can both be used for CD, however they do have some difference. And as I know no feature in YAML pipeline can be equivalent to the manual trigger in Classic Release.

For now the manual trigger is not supported in YAML pipeline, see this discussion. Good news is that the Product team has considered the feature request and the new feature is on Roadmap. (Perhaps on plan for 2020 Q3)

According to the team there: The scope of new feature they are thinking here is to be able to mark a stage as "always start manually". If there are other stages that depend on this stage, then those would continue to wait till this stage has executed.

We may have to wait for some time before the manual trigger feature comes true in Yaml pipeline. Hope the new feature would meet your needs.

0
votes

Microsoft says that their teams internally use Release Flow branching strategy: Release Flow: How We Do Branching on the VSTS Team

Release Flow means that the release branch has to be created to make the release triggered, which can look this way:

releases/productname-sprint02

Therefore, creation of a such branch can act as the manual trigger

In multi-stage YAML pipeline the production deployment stage should be coded to be triggered when the pipeline execution is the release branch context, which is not hard to do using a condition: and an expression that contains a check:

${{ startsWith(variables['Build.SourceBranch'], 'refs/heads/releases')

p.s. My recent blog on the similar subject: Azure DevOps – YAML pipelines and branching strategies