Skip to content

ChristophBe/migration-tool

Repository files navigation

Migration Tool

This migration tool should support the migration process between versions of applications. With the migration tool steps that are based of bash scripts can be defined and orchestrated.

Usage

The documentation of the Available commands and flags can be found here.

Run with Docker

docker run -v ./examples/migrations:/migrations -v ./output:/output ghcr.io/christophbe/migration-tool:latest -execution-filename ./output/execution-log.yaml run

Migrations File

The migrations.yaml file should be structured as follows:

migrations:
  - filename: 001_first_step.sh
    description: |
      Execute step one of the migrations.
    hash: <auto-generated>
  - filename: 002_second_step.sh
    description: |
      Execute step two of the migrations.
    hash: <auto-generated>

Development

Setup

  1. Clone this Repository
  2. Install needed development tooling.
    • Golang CLI Version 1.24 or later
    • mockery for generation of mocks
    • (optional) cobra-cli cobra-cli for generation code for new command

Run and Build

Run from Code

go run  github.com/ChristophBe/migration-tool/cmd/migration-tool

Build executable

go build  github.com/ChristophBe/migration-tool/cmd/migration-tool

Run Tests

go test ./...

Generate Code

For testing mock implementations of interfaces are used. To generate the mocks mockery is used. In addition to mock the documentation, for usage of the CLIs also gets generated.

To run regenerate the generated files run the following command:

go generate

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages