How do I create pipeline variables for a YAML-base

2020-04-08 07:15发布

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.

1条回答
Ridiculous、
2楼-- · 2020-04-08 07:42

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:

enter image description here

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

查看更多
登录 后发表回答