简体   繁体   English

在 Azure Devops 发布管道中更改 yaml 文件的分支

[英]Changing the branch of the yaml file in an Azure Devops Release Pipeline

I have an existing Azure Devops pipeline and I would like to change the branch that contains the yaml file.我有一个现有的 Azure Devops 管道,我想更改包含 yaml 文件的分支。 The pipeline has a lot of variables, so I would prefer to not have to create a new one from scratch.管道有很多变量,所以我宁愿不必从头开始创建一个新的。 When editing the pipeline, I see that I can change the location of the yaml file within the branch.编辑管道时,我看到我可以更改分支内 yaml 文件的位置。 And I also see the dropdown that can be used to switch branches.而且我还看到了可用于切换分支的下拉菜单。 But I don't see a way to save that new branch configuration.但是我看不到保存新分支配置的方法。

Has anyone else had this problem?有没有其他人有这个问题?

1.If those variables are defined in xx.yml file, to reuse those variables in another branch(Call it Y branch) that doesn't contain the xx.yaml file, you only need to check in that file to Y branch like Anthony suggests above. 1.如果这些变量是在xx.yml文件中定义的,要在另一个不包含xx.yaml文件的分支( xx.yaml Y分支)中重用这些变量,你只需要像Anthony一样将该文件检入到Y分支上面建议。 Then the pipeline will locate that file(if it matches Yaml File path ), and you can choose to run the pipeline with configuration from the branch you want.然后管道将找到该文件(如果它与Yaml File path匹配),您可以选择从您想要的分支运行带有配置的管道。

In addition: After that, don't forget to modify the triggers cause you're now in another branch.另外:之后,不要忘记修改触发器,因为您现在在另一个分支中。

2.And if you already have one xx.yml file in Y branch, you only need to copy the content of variables: part from current yaml file to yaml file in Y branch and commit the change. 2.如果你已经在Y分支有一个xx.yml文件,你只需要将变量的内容部分从当前yaml文件复制到Y分支的yaml文件并提交更改。

Hope it helps :)希望能帮助到你 :)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM