Keeping your schemas in version control
Version control is essential in software development since it helps individuals and teams manage, collaborate, and safeguard their projects.
Since your Enterspeed schemas are the basis for your site's content structure, it makes sense to include it in your version control, e.g., GIT.
Also, schema creation and frontend development often happen simultaneously when developing a new feature.
To include your schemas in your version control, you will need to install the Enterspeed CLI.
Once done, you can clone your current schemas using the es-cli schema clone command. This will create a folder on your local machine called Schemas containing all your current schemas.
Next, type the es-cli deployment extract -e [your environment name] command. This command will generate a deployment plan specific to the provided environment. The resulting JSON file will include the schema alias and version number of all schemas that have been deployed to that particular environment.
You can now commit and push all your schemas and deployment plan to your repository. Next, let's see how to work with a schema locally.
Developing schemas locally
Now that we have our schemas on our local machine and in our version control, we're ready to start developing.
When we have made changes to a schema, e.g., updated a schema or created a new one, we need to import it to Enterspeed.
To do that, we use the es-cli schema import -a [schema alias] command. This command will import the schema, even if it's a new or updated schema. This way, you don't have to call either a create or save command.
To test your newly imported schemas, you can open the schemas inside the Enterspeed app, where you can test them against real source entities.
Once you have verified that all works as intended, it's time to deploy the schemas. Deploying schemas via the CLI is done using the es-cli schema deploy [schema alias] -e [your environment name] command.
The schema deploy command will trigger the deployment of the schema to the specified environment, initiating the processing and view generation. It will also update your local deployment plan to match the new version of the deployed schema.
That way, your deployment plan is always up to date and ready when you merge your change into the main branch.
Other developers can now run a full deployment to update their own environment using the es-cli deployment deployment deploy -e [your environment name] command.
Want to see how this works? Check out the video below.
If you are interested in seeing how you can use the Enterspeed CLI in your release pipeline, you can also check out this video below.