Git Product home page Git Product logo

kontent-migrations-boilerplate's Introduction

Kontent CLI migrations examples

The Kontent CLI boilerplate aims to help with your first migration code. We've provided sample migration scripts in the Migrations folder. These scripts are written in Javascript and Typescript to show you the basic operations.

If you are missing your use case, you might find answers in the Management API reference.

The Kontent CLI tool supports only Javascript files, so if you write your migrations in Typescript or any other language you have to transpile your code before running.

Installation

npm install

Setup

Before you run your migrations, you need to store some information about the environment locally.

The environment is defined as a named pair of values. For example, "DEV" environment can be defined as a pair of a specific project ID and Management API key. This named pair of values is stored within your local repository in a configuration file named .environments.json.

# Adds a 'DEV' environment reference.
kontent environment add --name DEV --project-id "<YOUR_PROJECT_GUID>" --api-key "<YOUR_MANAGAMENT_API_KEY>"

Usage

If you've set up an environment using the method above, you can use the prepared scripts to run all migrations in the Migrations directory.

# Executes all migration scripts in the 'Migrations' folder to the 'DEV' environment reference within your Kontent project. 
npm run migrate:all

If you want to run a specific migration you can use also script defined in packages.json

# Executes a migration script named 'my_migration'.
npm run migrate "my_migration"

Tip: For more information about Kontent migrations, see the Kontent CLI documentation.

Feedback & Contribution

Feedback & Contributions are welcomed. Feel free to take/start an issue & submit PR.

kontent-migrations-boilerplate's People

Contributors

winklertomas avatar simply007 avatar ileshmistry avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.