2

I have code in two github repositories that I would like to build and run in the same build pipeline.

Does anybody know if it's possible to clone/pull more than one repo during the 'get sources' step?

darren25
  • 275
  • 1
  • 5
  • 16
  • 1
    This question is very similar to this one: https://stackoverflow.com/questions/49571664/vsts-build-from-multiple-repositories – Setorica Jan 22 '19 at 14:03
  • 2
    Possible duplicate of [VSTS build from multiple repositories](https://stackoverflow.com/questions/49571664/vsts-build-from-multiple-repositories) – Yan Sklyarenko Jan 22 '19 at 15:23

1 Answers1

1

In Azure DevOps, a pipeline is only associated with a single repository, by default. However, there are options to include code from other Git repositories in to the build:

  1. Add Command Line task and execute git clone with a PAT in the pipeline
  2. Add the 2nd repository as a submodule to your primary repository. Make sure to check the 'checkout submodules' checkbox under 'Get sources' in the classic editor.
  3. Build each repository separately and use a RELEASE pipeline to bring them together as below:

From the left menu, choose "Releases" under the "Pipeline" group. (as of 14th Oct 2019). You will be able to add multiple artifacts to the pipeline by clicking on '+ Add'. The screenshot below shows 3 different sources. A docker image in Azure Container Registry, A build that has output artifacts & a GitHub repository.

Artifacts for the Pipeline

All the artifacts get copied to the build agent at run time in their own folders:

Azure DevOps - Release Pipeline

Vyas Bharghava
  • 6,372
  • 9
  • 39
  • 59