migrator

command module
v0.0.0-...-95be3d4 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2024 License: GPL-3.0 Imports: 20 Imported by: 0

README

migrator

migrator will clone one or more remote repositories in project and migrate, or transform, them to the kustomized-directory structure that the new gitops repository expects.

Here is an example of the kustomized-directory structure:

./
├── base/
│   ├── deployment.yaml
│   ├── env
│   ├── ingress.yaml
│   ├── kustomization.yaml
│   └── service.yaml
└── overlays/
    ├── beta/
    │   ├── env
    │   ├── kustomization.yaml
    │   └── patch.yaml
    ├── development/
    │   ├── env
    │   ├── kustomization.yaml
    │   └── patch.json
    └── production/
        ├── env
        └── kustomization.yaml

The fields in the manifest files that it focuses on are the same as those that are interpolated in an application repository's .kube directory (if present, of course).

These manifests are:

  • deployment
  • service
  • ingress

migrator will first clone one or more repositories, depending on the command. Here are some ways in which it can be invoked:

Migrate all of the repositories in Bitbucket in the AION project:

./migrator --project AION

Migrate all of the repositories listed in the aion.txt file:

./migrator --project AION --file aion.txt

Migrate a single repository:

./migrator --project AION --file <(echo aion-finance-micro)

Migrate the results of another operation:

./migrator --project AION --file <(comm -13 <(sort ../son-of-validator/local.txt) <(sort ../son-of-validator/cloud.txt))

Because the tool can be passed a file, process substitution can be used to come up with many clever ways to pass in repository names dyanimcally, some of which can be seen in the examples above.

Miscellaneous

curl -sL \
    -H "Accept: application/vnd.github+json" \
    -H "Authorization: Bearer $GITHUB_TOKEN" \
    -H "X-GitHub-Api-Version: 2022-11-28" \
    https://api.github.com/user/repos \
    | jq -r ".[].full_name"

References

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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