Inside a Config File: Reusable Config Opportunities

1) Config SDK

CircleCI config files are written in YAML but that doens’t mean they have to be built using YAML. The Config SDK is a javascript/typescript SDK that can be used to generate configuration files. This can be used to generate config manually or, using dynamic config, to generate them each time a pipeline is triggered.

2) Orbs

Orbs can be used to share configuration keys across an organization. This is especially useful if all projects need to use a certain tool. The commands, executors , and parameters required to use the tool can be built into the orb.

CircleCI and our Partners maintain a number of orbs for common tools so reviewing the orb registry is a great way to save yourself some time. Even if you need to create a private orb, the orb registry contains numerous examples to reference from other users.

3) Reusable Config

Review the config file for any repeated configuration keys. Repeated keys should be consolidated into a reusable key or added to an orb. Creating parameterized jobs allows for implementation of dynamic config and leads to an easier to manage config in most cases.

Next Step: Inside the Config: Dynamic Configuration

Was this article helpful?
0 out of 0 found this helpful



Article is closed for comments.