Azure Devops构建之间的区别-队列与运行管道REST API [英] Difference between Azure Devops Builds - Queue vs run pipeline REST APIs

查看:73
本文介绍了Azure Devops构建之间的区别-队列与运行管道REST API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我确实看到了两个运行Azure devops管道的选项

  1. 运行管道->

    什么时候使用什么?

    选择为YAML管道运行管道,并选择https://docs.microsoft.com/en-us/rest/api/azure/devops/pipelines/runs/run%20pipeline?view=azure-devops-rest-6.0

  2. Build queue - > https://docs.microsoft.com/en-us/rest/api/azure/devops/build/builds/queue?view=azure-devops-rest-6.1

I would like to understand differences of both APIs and when to use what?

解决方案

I would like to understand differences of both APIs.

Azure Devops provides Classic UI builds and Yaml build pipelines. These two APIs can both start a pipeline run (No matter Classic UI Build pipeline or Yaml Build pipeline). The biggest difference between the two APIs exists in their Request Body:

1.You should know that Yaml pipeline has introduced an important function Runtime parameters. We can pass variables and parameters when using Run pipeline API, but we can only pass variables when using Builds-Queue API.

The new Run pipeline API coming after api-version 6.0 supports passing parameters/variables which are important for Yaml pipelines. But the old Queue-build doesn't support parameters, it only support variables (The parameters here is actually variables, it's not real parameters for YAML).

2.What's more, we can use normal yaml pipeline for both CI and CD. It's multi-stage Yaml pipeline. To run such pipeline, it's strong recommended to use Run pipeline.

Check the Request Body of Run pipeline carefully and you'll find the Run pipeline is more related to Yaml pipeline. The StagesToSkip element and yamlOverride are unique functions for YAML pipeline.

When to use what?

Chose Run pipeline for YAML pipeline and chose Builds-Queue for Classic UI Build pipeline. It's not necessary (both these two APIs can start Classic Build run and Yaml Build run) but it's more recommended.

这篇关于Azure Devops构建之间的区别-队列与运行管道REST API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆