Skip to content
This repository has been archived by the owner on Jan 15, 2023. It is now read-only.

A demo repository showcasing a monorepo pipeline using CircleCI's new API v2 endpoints and Pipelines capabilities.

License

Notifications You must be signed in to change notification settings

mvxt/circleci-demo-monorepo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CircleCI Demo Monorepo

An example monorepo pipeline in CircleCI with Go services.

What's happening in this project?

  1. The gatekeeper workflow consists of a single gatekeeper job that runs by default on all commits and other triggers.
    • Inside the gatekeeper, we are scanning for which folders have changed and then making an API call using our v2 API to trigger the pipeline.
    • When making the API trigger, we must specify parameters to set gatekeeper to false so that it doesn't retrigger the same workflow in a loop, and only trigger the desired service workflow(s).
  2. The API call triggers another workflow, service, which will have jobs that run specifically for said service(s). The name of the service is passed as a parameter in the API call.

Notes, Known Shortcomings, Desired Features

  • This only works if each service in the monorepo follows the same steps / process (e.g. whatever is in service job). If different services require different tasks and steps, then you'd need to define different jobs and corresponding workflows for them.
  • This project assumes the project names match the folder names. If not, then you'll need to account for that in your config.
  • We're using built-in pipeline parameters to compare current commit to previous commit. Ideal is to compare against last commit built on CircleCI, not just the last commit in the log (since multiple commits can be pushed, and only latest one is built).
  • Script in gatekeeper job does not cover the scenario where a branch does not have a previous commit. I believe that will break.
  • Need to implement comparing tags

About

A demo repository showcasing a monorepo pipeline using CircleCI's new API v2 endpoints and Pipelines capabilities.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published