GithubHelp home page GithubHelp logo

krakend-config-migrator's Introduction

KrakenD version migration

This application migrates existing KrakenD configurations from one major version to another (e.g: 1.x to 2.0).

The application overwrites the target files with the resulting new configuration. Therefore, you should keep your configuration files under a git tree to review or revert changes quickly.

The application works with any file extension of your choice (patterns), but it defaults to *.json (simple configuration) or *.tmpl (usually flexible configuration).

You can migrate KrakenD configurations with thousands of files/templates in seconds.

Make sure to review the changes after the migration.

Usage

Download the binary for your platform or build the source code (see below). From the folder where the binary is, execute it:

$ ./krakend-config-migrator -h
Usage of ./krakend-config-migrator:
  -c int
        concurrency level (default 24)
  -m string
        path to a custom mapping definition
  -p string
        patterns to use to contain the file modification (default "*.json,*.tmpl")

All flags are optional and usually not needed unless you use custom rules, YAML configuration, or other non-standard options.

Pass your krakend project directory as an argument. The application is recursive and will look for all files matching the .json and .toml extensions. For instance:

$ ./krakend-config-migrator mykrakendproject

If your KrakenD configuration is split into multiple repositories, you can pass them all at once, simply passing the list of folders:

$ ./krakend-config-migrator folder1/ folder2/ folder3/

After execution, your krakend configuration files, templates, and subtemplates should be migrated to the latest version.

YAML and other formats

The tool works, too, if you want to change the version to YAML, TOML, or other formats (even documentation .md). To do that, pass the pattern you'd like to use -p "*.yml,*.md".

The only limitation for non JSON files is that you will need to manually change the version value. Set version = 3 for KrakenD 2.0 and above.

Build

If you need to make modifications to this migration tool:

1- Clone the repo

git clone [email protected]:devopsfaith/krakend-config-migrator.git

2- Modify it and build it:

cd krakend-config-migrator
go build ./cmd/krakend-config-migrator

krakend-config-migrator's People

Contributors

alombarte avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

krakend-config-migrator's Issues

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.