First, to understand how it works add couple of repos to a team project and add some code to each repo. In this example, you can find three repos defined in the team project MultiRepoBuild, namely MultiRepoBuild, multiRepo1 and multirepo2.
In each repo, a .NET Core Web App is added.
In one of the repos, you can define the YAML pipeline.
As the build pipeline code is added to the MultiRepoBuild repo, we need to refer the other two repos in the YAML definition. This can be done with the syntax shown below.
Then, you can define checkout steps. Checkout self says to checkout the MultiRepoBuild repo, as it is the repo containing the YAML pipeline code. The other two repos are checked out with specifying their names.
You can add a step to view the content of the build source directory, which will show the three repos available in the build source directory as three folders.
Then we can use build steps to build projects from each repo.
The full pipeline code is shown below.
The pipeline executes and builds code from multiple repos.
No comments:
Post a Comment