Best practice for reusing circleci config between application repos

Hi,
I’m looking for a way to share the same pipeline between multiple applications. The goal is to mitigate many copy/paste between application repositories when I add a new feature to the pipeline.

Right now, I have about 50 applications repositories, and each has a similar pipeline (config.yml file). I was thinking of putting the config.yml in a separate repository and using it as a submodule in application repo. Does anybody have other ideas or experience with that?

Thanks

Hi @danielinclouds,

For sharing parts of config files across repositories you could look into authoring an orb - Introduction to Authoring Orbs - CircleCI

Hope this helps!

Thanks for your reply, @zmarkan.

I’m already using orbs for sharing parts of the configuration, but what I’m looking for is sharing the full configuration.

One example that I might add is using Terraform to deploy cloud resources. I have multiple repositories for that, but credentials are always the same, and pipeline is always the same. Right now, I have to copy the pipeline file to each repository when I change something.

One thing I would like to see is a pre-processing step that lets users build their config.yml in code before the CI config is run. My use case would be to split up complicated YAML files into pieces and assemble them before running.

That would help the above use case too - pieces could be fetched from a single source, and transformed/parameterised if necessary.