One doubt, I am using Azure DevOps for a number of automations. I would like to keep all the pipelines that I am creating in a different repository where the code is located, but both within the same Azure DevOps project. How can I tell the YAML that this pipeline does not point to the repository in which it is located, but to the one in which the code is located?
Asked
Active
Viewed 1,378 times
1 Answers
1
The tool to do this is a repository. You will add a structure like this:
resources:
repositories:
- repository: Tuto-Ressources
ref: main
type: git
name: TemplateRepository
name is the name of the repository and repository the name of the ressource. Yu can the invoke it with template.
This is the doc:

Frédéric De Lène Mirouze
- 545
- 5
- 25
-
Thanks for your quick answer Frederic, I'm having a new doubt, if I have many repos in the same pipeline, how I should reference each when I want to use it? I mean, what you answered is the way to declare the repo (such as a var in common programmin), but how do I reference to it during the pipeline, how I should call it to reference to it. Sorry if the question is basic, I'm new at DevOps (fighting all day as you can deduce). – MANZARBEITIA Oct 14 '21 at 05:46
-
It depends on what you want to do. checkout will download files from your repository. But sometimes you don't need. I also have a problem and asked this question: https://stackoverflow.com/questions/61729574/azure-devops-multistage-pipeline-yaml-how-to-checkout-multiple-repos – Frédéric De Lène Mirouze Oct 14 '21 at 07:10