https://github.com/suzuki-shunsuke/circleci-config-merge
Generate .circleci/config.yml by merging multiple files
https://github.com/suzuki-shunsuke/circleci-config-merge
Last synced: about 20 hours ago
JSON representation
Generate .circleci/config.yml by merging multiple files
- Host: GitHub
- URL: https://github.com/suzuki-shunsuke/circleci-config-merge
- Owner: suzuki-shunsuke
- License: mit
- Created: 2020-11-03T00:44:14.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2024-05-28T15:58:22.000Z (11 months ago)
- Last Synced: 2024-05-29T07:09:24.618Z (11 months ago)
- Language: Go
- Size: 673 KB
- Stars: 12
- Watchers: 3
- Forks: 1
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# circleci-config-merge
[](https://github.com/suzuki-shunsuke/circleci-config-merge/actions)
[](https://codeclimate.com/github/suzuki-shunsuke/circleci-config-merge/test_coverage)
[](https://goreportcard.com/report/github.com/suzuki-shunsuke/circleci-config-merge)
[](https://github.com/suzuki-shunsuke/circleci-config-merge)
[](https://raw.githubusercontent.com/suzuki-shunsuke/circleci-config-merge/main/LICENSE)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](https://en.wikipedia.org/wiki/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](https://github.com/suzuki-shunsuke/circleci-config-merge/releases).
You can install circleci-config-merge with [Homebrew](https://brew.sh/) too.```console
$ brew install suzuki-shunsuke/circleci-config-merge/circleci-config-merge
```You can install circleci-config-merge with [aqua](https://aquaproj.github.io/) 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](examples) and [example-cirleci-config-merge](https://github.com/suzuki-shunsuke/example-circleci-config-merge).
## How to use
```
$ circleci-config-merge merge [ ...] > .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](https://github.com/homeport/dyff).
Please see the example [suzuki-shunsuke/example-circleci-config-merge](https://github.com/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](https://circleci.com/docs/2.0/configuration-reference/).
## Merge Rule
Coming soon.
## LICENSE
[MIT](LICENSE)