Search code examples
gentics-mesh

How to seed schemas in Gentics Mesh


I'm working with a team of developers, and we need to be able to stand-up a Mesh instance with all the predefined schemas on anyone's laptop.

I'd like to be able to create schemas if they don't exist, based on a collection of JSON files.

I've started a Gentics Mesh plugin that will look for the schema files, then add them via the MeshRestClient.

Is that a good approach?

I'm following the HelloWorld example here to get started -
https://github.com/gentics/mesh-plugin-examples/blob/master/hello-world-plugin/


Solution

  • So I built a "mesh-seeding-plugin", and it worked as expected.

    It uses a config file to get the list of json schemas to load up, then when the plugin initializes, it created the schemas if they don't exist.