This repository is used as a collection for useful contentful tools. The first tool added, is a migration tool to support schema creation in CI/CD.
- Make sure Node.js (>= v18) and NPM NPM is installed
- Set up / Access to a Contentful space with read / write permissions
-
Clone this repository
-
Run
npm install
on root level (it's a monorepo using npm workspaces) -
Create a new
.env
file based on the.env.sample
file from the root folder of this repo and add your contentful credentials:CONTENTFUL_SPACE = **SPACE_ID** CONTENTFUL_MANAGEMENT_TOKEN = **PERSONAL_ACCESS_TOKEN**
Run the migration tool via npm run migration-tool <args...>
with the following argument options:
| deploy new version of production environment by running all new migrations |
| run new migrations on the current staging environment |
| test new migrations by running them against a new temporary ci environment |
| delete the contents of the stage environment and reset it to the state of the current master environment |
| create a new migration file |
| compares the content types of environment1 with environment2 based on a JSON file comparison |
| generates typescript types from all content types in the given environment . Types based on contentful.js library types. |
| list all available environments |
To test the the migration tool is setup correctly and is connected to the contentful space, you can run npm run migration-tool listEnvironments
and you should see a table with all created environments on your contentful space.
Order of the following list does not necessarily represent prioritization
- Publish as installable / executable NPM package
- Make it backwards compatibility with Contentful CLI < 10
- Add example migrations based on commonly used content types, e.g. Page Metadata, CTA, Accordeon, Tabs, MediaWrapper
- Create a documentation page
- Generalise deploy{Env} / reset{Env} scripts
- Add CSV (Excel, Numbers) to JSON Converter for content imports
DieProduktmacher GmbH Hofmannstraße 7a 81379 Munich
E-Mail: code[at]produktmacher.com Website: www.dieproduktmacher.com