Y.L
Y.L

Reputation: 764

Azure DevOps - How do I create a build pipeline using more than one repository?

When creating a new Build Pipeline, the first stage is to select a repository.

I want to create a build for a Java project on one repository, but also include imports and configurations that reside on a different repository (Both are Azure Repos Git).

Is that possible?

Upvotes: 3

Views: 1014

Answers (1)

Shayki Abramczyk
Shayki Abramczyk

Reputation: 41545

Update: Microsoft added this feature (in Sprint 161) and if you use YAML pipeline you can clone multiple repos in this way:

resources:
repositories:
 - repository: tools
   name: tools
   type: git

steps:
- checkout: self
- checkout: tools

More info you can find here.


(The old answer)

Currently you can't specify more then one repository in the "Get Sources" phase.

There is a Feature Request about it and the status is On Roadmap.

You have 2 options:

1) Git solution - create the second repository as submodule in the first repository. then in the "Get Sources" you can check the checkbox checkout submodules, then Azure DevOps will bring the two repositories into the agent.

enter image description here

2) Azure DevOps solutuin - add a Command Line or a PowerShell task that bring the second repository to the agent with git clone second-repo-url.

enter image description here

Upvotes: 4

Related Questions