steps

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2026 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompareVersion added in v1.3.13

func CompareVersion(a, b string) int

CompareVersion orders dotted numeric versions component by component, so V1.2 precedes V1.10 and V5.0 precedes V10.0, where a plain string sort would not. Non numeric components fall back to string comparison.

func ParseFilename

func ParseFilename(name string) (version, slug, label string, ok bool)

Types

type Config

type Config struct {
	Name        string `yaml:"name"`
	Description string `yaml:"description"`
	Version     string `yaml:"version"`
	Steps       []Step `yaml:"steps"`
}

func Load

func Load(path string) (*Config, error)

func (*Config) Slugs

func (c *Config) Slugs() map[string]bool

type File

type File struct {
	Step    Step
	AbsPath string
	Rel     string
	Name    string
	Folder  string
}

type IncludeEntry

type IncludeEntry struct {
	Path     string `yaml:"path"`
	Fallback string `yaml:"fallback,omitempty"`
	Git      string `yaml:"git,omitempty"`
	Branch   string `yaml:"branch,omitempty"`
	Ref      string `yaml:"ref,omitempty"`
	Token    string `yaml:"token,omitempty"`
	Key      string `yaml:"key,omitempty"`
	URL      string `yaml:"url,omitempty"`
}

func (*IncludeEntry) UnmarshalYAML

func (e *IncludeEntry) UnmarshalYAML(node *yaml.Node) error

type Step

type Step struct {
	Name    string            `yaml:"name"`
	Type    string            `yaml:"type"`
	Slug    string            `yaml:"slug"`
	Schemas []string          `yaml:"schemas"`
	If      string            `yaml:"if"`
	Vars    map[string]string `yaml:"vars"`
	Include []IncludeEntry    `yaml:"include"`
	Exclude []IncludeEntry    `yaml:"exclude"`
	Pre     string            `yaml:"pre,omitempty"`
	Post    string            `yaml:"post,omitempty"`
}

func (*Step) Active

func (s *Step) Active() bool

Active evaluates the step's if expression with sh. An empty expression means the step always runs, mirroring eval_condition in migrate.sh.

func (*Step) ExpandVars

func (s *Step) ExpandVars() (map[string]string, error)

ExpandVars resolves each vars value through sh so env references and command substitutions behave exactly as eval echo does in migrate.sh.

func (*Step) ResolveFiles

func (s *Step) ResolveFiles(dbDir string) ([]File, error)

Jump to

Keyboard shortcuts

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