migration_tool

package module
v0.0.0-...-45fb69a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 18, 2025 License: MIT Imports: 0 Imported by: 0

README

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

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
cmd
gen-docs command
migration-tool command
internal
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL