Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Trigger pipeline build from sub directory in a monorepo

We're interested in moving a monorepo to git and would like to integrate it with a pipeline based CI/CD.

The general pattern we've seen so far is a single pipeline description file at the root of the repo, which implies a single pipeline per repo. This seems to be the pattern followed by Jenkins Pipeline, Gitlab, Bitbucket CI, CircleCI and others.

Given a monorepo, we would like multiple such files, one for each project in the repo.

Is there a pipeline style CI that does this?

The other alternative we can think of is a pipeline description file for all projects with custom filtering. Do any of the existing pipeline CI systems handle this without extra tooling?

like image 461
J Dunbar Avatar asked Oct 29 '22 05:10

J Dunbar


2 Answers

One solution is to bring your own solution by checking all the projects impacted by the commits which the CI has checked-out.

Once you have your list of projects you run all the tasks you need to run on each one of the projects impacted by changes.

like image 99
Coyote Avatar answered Nov 10 '22 05:11

Coyote


I created some showcase for monorepo with Gradle as build tool and CircleCI or Bitbucket pipelines as CI tool.

See: https://github.com/zladovan/monorepo

Gradle specific stuff should be replaceable quite easily by something else. Just change tools/ci/core/list-dependencies.sh.

like image 28
Ján Čabala Avatar answered Nov 10 '22 05:11

Ján Čabala