Tutorial: Handle Monorepos via CI/CD pipeline

A monorepo is a popular software development strategy to maintain multiple microservices in one source code repository. If you currently use a code-repository service different than GitHub, you can still capture your monorepo structures via a custom integration using the CI/CD endpoint as detailed below.

How to represent in VSM

LeanIX VSM supports hierarchies, i.e. parent-child relations, which can become handy for navigation & search. Monorepos are represented best in a hierarchy, e.g.

|_ Software Artifact 1 (Repo name)
   |_ Software Artifact 1.1 (Monorepo#1)
   |_ Software Artifact 1.2 (Monorepo#2)
   |_ Software Artifact 1.3 (Monorepo#3)

Import the actual repository

The repository itself can be imported via the GitHub Repository integration.

Import the monorepos

An easy way to augment the monorepo information is via CI/CD integration. In the metadata file, add custom attributes, e.g.

id: cicd-connector-v2
name: cicd-connector-v2
description: CI/CD revamped
self: https://github.com/leanix/cicd-connector-v2/blob/main/lx-manifest.yml
owner: [email protected]
teams:
  - cider
products:
  - leanix-vsm
links:
  - name: vcs
    url: https://github.com/leanix/cicd-connector-v2 
monorepos:
  - repo1
  - repo2
  - repo2

Now, you can add a custom integration API configuration on top of the predefined configuration, which creates a software artifact Fact Sheet for the monorepo, as well as the corresponding relToParent relation to the actual repo.

See also the tutorial to add custom logic to the CI/CD integration for more details.


Did this page help you?