Awesome
circleci-config-merge
Generate .circleci/config.yml by merging multiple files
Blog
https://dev.to/suzukishunsuke/splitting-circleci-config-yml-10gk
Motivation
Our motivation is to split a huge .circleci/config.yml per service.
We have a monorepo where many services are managed.
.circleci/config.yml
of this repository has over 6000 lines, and it's hard to maintain the file.
Why don't we use circleci config pack
?
The directory structure and naming rule don't match our needs. And we want to merge the list of workflow's jobs.
Install
Download from GitHub Releases. You can install circleci-config-merge with Homebrew too.
$ brew install suzuki-shunsuke/circleci-config-merge/circleci-config-merge
You can install circleci-config-merge with aqua too.
After installing circleci-config-merge, please check if it is installed properly.
$ circleci-config-merge --version
circleci-config-merge version 0.1.0
Example
Please see examples and example-cirleci-config-merge.
How to use
$ circleci-config-merge merge <file> [<file> ...] > .circleci/config.yml
How to test in CI
In CI, we should test whether .circleci/config.yml
and the result of circleci-config-merge merge
is equal as YAML.
circleci-config-merge
doesn't provide the feature to compare YAML, so please use the other tool like dyff.
Please see the example suzuki-shunsuke/example-circleci-config-merge as a reference to split .circleci/config.yml and setup CI.
Split File Format
The split file format is same as .circleci/config.yml.
Merge Rule
Coming soon.