Rate this page:
Configuration as code (config as code) is an automated method of maintaining Compass component data in a Git repository. You can choose to declare component details in a YAML file that sits alongside the source code for the component itself. Learn more about how config as code works
With config as code, you can take an existing Compass component and move its source of truth to a YAML configuration file in your code repository. Once you connect the component with your repository, update the component's data by updating the YAML configuration file. Any updates to the YAML file on your repository’s default branch automatically sync back to Compass and reflect in Compass.
In this way, you can use the same version control practices for maintaining component data as you use for the rest of your codebase.
Compass currently supports config as code with Bitbucket Cloud, GitHub Cloud, and GitLab.com.
Here’s how config as code works:
compass.yml. Each component has its own
compass.yamlfile. Learn more about the structure and contents of a compass.yaml file
compass.yamlfile to the default branch (i.e. main or master usually) in your repository. Learn how to manage components with config-as-code
compass.yamlfiles in separate subfolders anywhere in your repository structure. This is helpful if you have a monorepo.
compass.yamlfile in your repository becomes the source of truth for all the component’s details. You now manage the component by making changes only in the
compass.yamlfile, not via the Compass UI or API.
compass.yamlfile. Learn how to update a component managed via config as code
compass.yamlfiles with scripts or build jobs to help keep information fresh.
Rate this page: