Desired flow promoting custom types and slice definitions through multiple environments

We are looking into how to incorporate the slice machine sync in our CI/CD pipeline (on Azure DevOps), combined with Prismic's feature of having multiple environments. So far we found out that there is no slice-machine cli and that the prismic cli does not have a feature to sync (upload) custom types and slices.

The desired development flow

Given we have the following Prismic setup:

  • Production repository, with 2 additional environments
  • Acceptance (staging) environment
  • Testing (staging) environment
  • All custom types and slice definitions live in a single GIT repository

We have a top-down content flow:

  • The content flows from Production to Acceptance to Testing.
  • This is done via de Prismic dashboard, manually

We would like to have a bottom-up flow for custom types and slice definitions:

  • The definitions flows from Testing to Acceptance to Production
  • The DTAP-flow is a common software development flow, often mandated by organisations
  • Promotion of the content and slice definitions is done via a CI/CD pipeline using a cli command or script

The issue

We are investigating how to do the promotion of custom types and slice definitions via CI/CD as manually syncing from local to production via Slice Machine is undesired (risk). The recommended way seems to use the customtypes-api, for custom types. We then have to create a script/program to use that API. Same API seems to be usable for syncing slices, which slice machine seem to as well.

It seems we are not the only one looking into this:

Am I missing something? Are we expected to develop our own tool for syncing custom type and slice definitions to the desired environment? How does Prismic expect to use the environments in a professional CI/CD development flow?

Hi @tim.van.den.hof,

This is a topic/question we’ve been hearing a lot about since Slice Machine debuted.

The custom types API is the way to go for now. You will need to build your own script to set up automation with it. There is a custom types API client that should make this easier:

Let us know if you have any other questions.