Skip to content

Commit

Permalink
docs(plugin): add more information around config inheritance
Browse files Browse the repository at this point in the history
  • Loading branch information
blurrah committed Mar 31, 2023
1 parent fc34a04 commit 755c320
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ This plugin adds an integration for Vercel for use with MACH composer.
This allows you to streamline your configuration and share it as an integration with your MACH components.

## Requirements
- [MACH Composer 3.x](https://github.com/labd/mach-composer)
- [MACH Composer >=2.5](https://github.com/labd/mach-composer)
- [terraform-provider-vercel](https://github.com/vercel/terraform-provider-vercel)

## Usage

You can set up configuration variables on both a global and a component specific level.
All values set on a global level will be inherited and potentially overwritten by its components.
You can set up configuration variables on a global, a site and a component specific level. Inheritance will take place on each level, combining configuration from global
all the way down to a component level.

Example of setting up global and component level configuration:
```yaml
Expand All @@ -30,6 +30,11 @@ global:
sites:
- identifier: my-site
# ...
vercel:
project_config:
environment_variables:
- key: SITE_SPECIFIC_ENVIRONMENT_VARIABLE
value: site
components:
- name: my-component
vercel: # Override defaults on component level
Expand All @@ -41,7 +46,7 @@ sites:
type: "github"
repo: "mach-composer/my-vercel-project"
environment_variables:
- key: CUSTOM_SITE_SPECIFIC_ENVIRONMENT_VARIABLE
- key: CUSTOM_COMPONENT_SPECIFIC_ENVIRONMENT_VARIABLE
value: custom
environments: ["preview"]
```
Expand Down

0 comments on commit 755c320

Please sign in to comment.