Inside a Config File: Reusable Config Opportunities

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.

:arrow_forward: Next Step: Inside the Config: Dynamic Configuration

:arrow_backward: Previous Step: Inside the Config: Config Security Opportunities

📑 Table of Contents

Self Service Configuration Review Overview

  1. Configuration Review Preparation
  2. Review Each Job for Improvement Opportunities
  3. Review Each Workflow for Improvement Opportunities
  4. High Level Improvement Opportunities
  5. Finalize Review