yey

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	IsDryRun bool
)
View Source
var (
	IsVerbose bool
)

Functions

func ContainerName

func ContainerName(path string, context Context) string

ContainerName returns the container name to use for given yey rc path and context

func ContainerPathPrefix

func ContainerPathPrefix(path string) string

func ImageName

func ImageName(dockerfile []byte) string

func Log

func Log(format string, a ...interface{})

Types

type Context

type Context struct {
	Name       string     `yaml:",omitempty"`
	Variations Variations `yaml:"variations"`
	Remove     *bool
	Image      string
	Build      DockerBuild
	Env        map[string]string
	Mounts     map[string]string
	EntryPoint string `yaml:"entrypoint,omitempty"`
	Cmd        []string
	Network    string
	Platform   string   `yaml:"platform,omitempty"`
	DockerArgs []string `yaml:"dockerArgs,omitempty"`
}

Context represents execution configuration for some docker container

func (Context) Clone

func (c Context) Clone() Context

Clone returns a deep-copy of this context

func (Context) GetAllImagesAndPlatforms added in v0.5.1

func (c Context) GetAllImagesAndPlatforms(platform string) []ImageAndPlatform

GetAllImagesAndPlatforms returns the list of image names referenced in context recursively

func (Context) GetCombos added in v0.3.0

func (c Context) GetCombos() [][]string

GetCombos returns the list of all possible context name combinations user can choose from

func (Context) GetContext added in v0.3.0

func (c Context) GetContext(names []string) (Context, error)

GetContext returns context resulting from merging contexts with given names from all variations

func (Context) Merge

func (c Context) Merge(source Context, withVariations bool) Context

Merge creates a deep-copy of this context and copies values from given source context on top of it

func (Context) String

func (c Context) String() string

String returns a user-friendly yaml representation of this context

type ContextFile

type ContextFile struct {
	Version int
	Parent  string
	Path    string `yaml:"-"`
	Context `yaml:",inline"`
}

ContextFile represents yey's current config persisted to disk

type Contexts

type Contexts struct {
	Path string
	Context
}

Contexts represents a combinaison of base and named contexts

func LoadContexts

func LoadContexts() (Contexts, error)

LoadContexts reads the context file and returns the contexts. It starts by reading from current working directory and resolves all parent context files.

func (Contexts) Merge

func (c Contexts) Merge(source Contexts) Contexts

Merge creates a deep-copy of this object and copies values from given source object on top of it

type DockerBuild

type DockerBuild struct {
	Dockerfile string
	Args       map[string]string
	Context    string
}

type ImageAndPlatform added in v0.5.1

type ImageAndPlatform struct {
	Image    string
	Platform string
}

type Variation added in v0.4.0

type Variation struct {
	Name     string
	Contexts map[string]Context
}

func (Variation) Clone added in v0.4.0

func (l Variation) Clone() Variation

Clone returns a deep-copy of this variation

func (Variation) Merge added in v0.4.0

func (l Variation) Merge(source Variation) Variation

Merge creates a deep-copy of this variation and copies values from given source variation on top of it

type Variations added in v0.4.0

type Variations []Variation

func (Variations) Clone added in v0.4.0

func (l Variations) Clone() Variations

Clone returns a deep-copy of this variation

func (Variations) GetByName added in v0.4.0

func (l Variations) GetByName(name string) (Variation, bool)

GetByName returns variation with given name and whether it was found

func (Variations) Merge added in v0.4.0

func (l Variations) Merge(source Variations) Variations

Merge creates a deep-copy of this variation and copies values from given source variation on top of it

func (*Variations) UnmarshalYAML added in v0.4.0

func (variations *Variations) UnmarshalYAML(n *yaml.Node) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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