Guidance on what to include in Website repo from Cockpit

I love this CMS! I’ve been having a problem with figuring our what is appropriate to include or exclude from our repos and wanted to get some suggestions.

At first I was excluding everything except the storage folder, which seems to have been a good approach but then just in case a marketing person made a change to the CMS content on the live website it becomes out of sync locally and then we can write over the changes accidentally on the next commit, which becomes very hard to keep track of.

Now I’m thinking it’s best just to completely ignore the entire cockpit folder from the repo just to be sure CMS content doesn’t get written over accidentally.

What’s the best approach do you think?

I’ve had the same issue and I’ll describe what I’m currently doing, but I’d love to hear from someone with more experience.

  • I exclude everything in storage from version control EXCEPT storage/collections. I don’t deploy storage/collections, but I do pull it from production into my repo periodically so that my local collection config matches the production environment.
  • I maintain a config/config.yaml for both production and local usage. This is the main file that differs between the two systems.
  • All of my custom code is in either in config/api and addons.
  • If you intend to make any changes to cockpit itself, you should ignore node_modules and make sure npm install && npm build is part of your deploy step.

This sounds like a good idea too. Is the schema not associated with the database at all?

For now I’ve removed the cockpit folder completely from the repo as it seems unreasonable to be able to keep the cms content in sync between production, staging and local repos.