0

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?

MANZARBEITIA
  • 103
  • 6

1 Answers1

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:

https://learn.microsoft.com/en-us/azure/devops/pipelines/yaml-schema?view=azure-devops&tabs=schema%2Cparameter-schema#resources

  • 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