Closed jbmoelker closed 11 months ago
Logic to get DatoCMS environment matching the current branch, defaulting to the primary environment: https://github.com/voorhoede/head-start/blob/d241311edf55e893800011ce611c598d19728f4c/scripts/lib/datocms.mjs
Easier alternative? Some config/datocms-env.json
file (or other format) that can be read synchronously by any tool (own build scripts, Astro, GraphQL gen, etc)
{
"branch-name-a": "datocms-env-x",
"branch-name-b": "datocms-env-y"
}
(and some rule to always default to the "main"
environment if no matching branch environment is found)
Could extend or add a similar file for other environments (like Supabase or Cloudflare D1 or ...) in the future.
File will grow, but since it's basically just for build tools I don't think that that's a real concern.
Resolved in a simpler way by #26 .
User story
As a developer/reviewer, I want Cloudflare deploy previews to use a specific related DatoCMS environment when it's available, so that I can review CMS changes on the connected deploy previews.
Checklist
feat/some-name
should use a DatoCMSfeat-some-name
when available. Note DatoCMS environment names can only contain lowercase letters, numbers and dashes)