Overview
Coherence is configured with a superset of cnc.yml
, the configuration language of the cnc
framework that powers Coherence. Read more about cnc
here. In Coherence, additional extensions at both the service and environment level are added with the x-coherence
yml block.
How to configure your services
You have 2 ways of configuration. These may be used interchangibly, and many advanced features are not part of the UI and must be configured in the yml. Let us know if an important one is missing for you!
One is the Services
tab UI:
The other is the cnc.yml
tab text editor:
Read about environment variables, which are another common element that needs to be configured.
Service Options
type
- frontend: for a static site
- backend: for a container
- database: for a managed DB (e.g. RDS or Cloud SQL)
- cache: for redis
- for backend services
- repo builds a container as part of the build. Coherence will provision a pipeline in your cloud, and manage cache during the build process, and push to your container registry in your own cloud account
- existing image will use an image built elsewhere. you can use a
static
tag, to reference the same tag on each deploy, or can usesha
mode to always use the build's git commit as the image tag, useful if you're building images elsewhere for each commit and want to reference them
- repo: which of the app's connected repos does this service live in?
- context: what is the build context for this service?
- Dockerfile: what is the path to the dockerfile to build? if not provided, Coherence will use
nixpacks
to build the service container
- tracking branch: if selected, will auto-build and deploy on a push to that branch
Configuration vs provisioning
After you add an environment and add new services, you need to submit a provision task before they will be applied to your cloud account. Under the hood, this will do the same thing as cnc provision
if you used cnc
directly. This is done at the collection level on the Provisioning Tasks
page. If there are any errors in applying to your cloud, they will be shown on the tasks after they complete.
Environment cloning
Once you've got a working environment, you can clone it in full or in part by using the Clone From Environment
option when creating a new environment.
For branch previews, you'll set a default environment to clone from on the app's settings page.
CNC vs Coherence
Coherence adds the x-coherence
yml block to cnc
.
- At the environment (top) level of the yml, this will be used for settings like Build Machine Type that are not relevant in CNC (since you decide what machine to install and run
cnc
on). - At the service level, this will be used for settings like "Track Branch Name" or "Repo ID" which are not relevant in CNC (since you decide what code is present when you run the
cnc
commands).