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.
The documentation of the Available commands and flags can be found here.
docker run -v ./examples/migrations:/migrations -v ./output:/output ghcr.io/christophbe/migration-tool:latest -execution-filename ./output/execution-log.yaml run
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>
- Clone this Repository
- 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
go run github.com/ChristophBe/migration-tool/cmd/migration-tool
go build github.com/ChristophBe/migration-tool/cmd/migration-tool
go test ./...
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