How do I create pipeline variables for a YAML-based pipeline?

大憨熊 提交于 2020-03-16 05:37:00

问题


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:


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.



来源:https://stackoverflow.com/questions/56174813/how-do-i-create-pipeline-variables-for-a-yaml-based-pipeline

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