This repository stores the configurations for various deployments of CARE.
The CARE front-end attempts to fetch configurations from /config.json endpoint.
💡 This endpoint can be overriden by defining
REACT_APP_CONFIG_URLto the desired URL that serves a valid configuration file.
For every deployment, a reverse proxy is set-up for the /config.json endpoint which is proxied the raw JSON configuration file stored in this repo.
All configurations follow a specific schema as defined in the config-schema.yaml.
The Validate Configurations workflow attempts to validate all configurations (JSON files)
present inside the configs/ directory.
Let's say a new key EXAMPLE_KEY is to be introduced to the configurations.
- Update the
config-schema.yamlfor the validation workflow to pass when the new key is present. - Define the
EXAMPLE_KEYfor all configurations present inside theconfigs/directory. - Run
npm testto validate the new configurations. - Update the
IConfiginterface in coronasafe/care_fe repo to match the new configurations schema.
Let's say a new deployment example-deployment is to be added.
- Create a copy of an existing configuration and rename it to
example-deployment.jsonin theconfigs/directory. - Update the configurations to match the specifics of the deployment.
- Run
npm testto validate the new configuration.
There are couple of advantages with this approach. It makes managing the configurations easier across multiple deployments, and more accessible to the team. Also, it makes it easier to not requiring to modify the environment variables post the docker image build, as these configurations are fetched from an external source now.
