Skip to content

circle-makotom/circle-combine-split-config

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Config splitting

This repository demonstrates the basic usage of the orb circle-makotom-orbs/config-splitting.

Quick hands-on

  1. Fork this repository.
  2. Go to https://app.circleci.com/settings/project/github/YOUR_GITHUB_ORG_NAME/circle-combine-split-config/advanced and enable the option "Enable dynamic config using setup workflows".
  3. Go to https://app.circleci.com/settings/project/github/YOUR_GITHUB_ORG_NAME/circle-combine-split-config and hit the "Follow Project" button there. This action will trigger the first pipeline for your forked project.

Then you will find that the first pipeline has generated 3 workflows: setup, A-main-workflow, and B-main-workflow, which are defined in .circleci/config.yml, subdir-a/.circleci/config.yml, and subdir-b/.circleci/config.yml, respectively.

Behind the scene

  • There are 2 "modular" configs: subdir-a/.circleci/config.yml and subdir-b/.circleci/config.yml. Note that these "modular" configs are syntactically valid CircleCI configs, except that these can reference resources defined in the "shared" config (an injected config explained in the below).
  • The "modular" configs to be combined are listed in .circleci/modular-config-list.txt.
  • .circleci/config.yml defines the setup workflow. The setup workflow calls run-all-modular-configs job of the config-splitting orb, and combines the configs listed in .circleci/modular-config-list.txt (which is specified in config-list-file parameter).
  • Optional: run-all-modular-configs injects continue-shared.yml into the combined config. This will let "modular" configs listed in .circleci/modular-config-list.txt to reference resources (commands, jobs, etc.) defined in the single "shared" config, avoiding common config stanzas appearing in each "modular" config.
  • The combined config generated by the setup workflow is passed back to CircleCI and then is executed accordingly.

About

Basic usage of circle-makotom-orbs/config-splitting

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published