如何为基于 YAML 的管道创建管道变量? [英] How do I create pipeline variables for a YAML-based pipeline?

查看:25
本文介绍了如何为基于 YAML 的管道创建管道变量?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用设计器/类构建管道,您可以使用要传递到任务中的默认值定义管道变量.如何对基于 YAML 的管道执行相同的操作?

我想创建三个构建管道,每个管道都有一个设置为不同值的变量.所有三个都指向一个 YAML 文件.

在那里你可以定义变量,他们会有一个复选框 - 可在排队时间设置.

With designer/class build pipeline, you can define pipeline variables with default values to be passed into the tasks. How do I do the same for a YAML-based pipeline?

I want to create three build pipelines, each would have a single variable set to a different value. All three point to a single YAML file. The documentation states:

You can choose which variables are allowed to be set at queue time and which are fixed by the pipeline author. If a variable appears in the variables block of a YAML file, it is fixed and cannot be overridden at queue time. To allow a variable to be set at queue time, make sure it doesn't appear in the variables block of a pipeline or job. You can set a default value in the editor, and that value can be overridden by the person queuing the pipeline.

It's not clear how to do this for YAML file.

I can create a template YAML file, and an individual YAML file for each config value that calls the template file, but then I can't set configuration value at run-time.

解决方案

when you edit the build definition (not when you create it, at least with default experience). you'd need to click on 3 dots and pick variables from the list:

and there you would be able to define variables, and they would have a checkbox - Settable at queue time.

这篇关于如何为基于 YAML 的管道创建管道变量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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