Hi, I am new to DatoCMS, and I am getting a bit stuck with integrating data into our stack.
The big problem to solve:
We are a team of 3 developers, and we are struggling with environments. We work in standard 2-week sprints. So if we start the sprint, we create an environment to work safely without disrupting production. By the time we get to the end of a sprint 2 weeks later, our environment is out of date with production. We cant promote our branch without losing all the content our editors have added/updated.
If we use maintenance mode, we block the content editors from doing their job. This would mean they would have one afternoon every two weeks to do all the content updates.
My attempt to solve this issue
After looking in the docs, I found the CLI and thought this could help. So the idea is that we can create scripts for all the models and blocks. Each of us would get an environment, and a âproductionâ and âstagingâ environment would be created.
Using the dato CLI, we can then create scripts and run them against our environment; when the updates are collected in staging, the scripts would update staging and once tested and approved, it goes into production.
The idea is that the scripts will run and update where changes have been made, leaving the content part intact.
The problem:
The problem I am running into is that you can only run a script once. So if you are creating a new block, for example. You have to get it 100% correct before you run your script. So letâs imagine you miss spelt something; you canât update and re-run the script.
If we had a script per Block, if we wanted to add to it or update it at a later stage, we canât just add it to the existing Block script we have to create a whole new script to add a field.
My questions
- Has anyone run into a scenario like mine and has come up with a workflow to combat this?
- Is there a way to run scripts multiple times?