user799755
user799755

Reputation:

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. 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. 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?

Upvotes: 1

Views: 1980

Answers (1)

LoLance
LoLance

Reputation: 28116

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. 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.

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.

Hope it helps :)

Upvotes: 0

Related Questions