yaml

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2017 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseLabel added in v0.5.0

func ParseLabel(in []byte) map[string]string

ParseLabel parses the labels section of the Yaml document.

func ParseLabelString added in v0.5.0

func ParseLabelString(in string) map[string]string

ParseLabelString parses the labels section of the Yaml document.

func ParsePlatform added in v0.5.0

func ParsePlatform(in []byte) string

ParsePlatform parses the platform section of the Yaml document.

func ParsePlatformDefault added in v0.5.0

func ParsePlatformDefault(in []byte, platform string) string

ParsePlatformDefault parses the platform section of the Yaml document.

func ParsePlatformString added in v0.5.0

func ParsePlatformString(in string) string

ParsePlatformString parses the platform section of the Yaml document.

Types

type Auth added in v0.5.0

type Auth struct {
	Username string
	Password string
	Email    string
}

Auth defines Docker authentication credentials.

type Axis added in v0.4.2

type Axis map[string]string

Axis represents a single permutation of entries from the build matrix.

func ParseMatrix added in v0.4.2

func ParseMatrix(data []byte) ([]Axis, error)

ParseMatrix parses the Yaml matrix definition.

func ParseMatrixString added in v0.4.2

func ParseMatrixString(data string) ([]Axis, error)

ParseMatrixString parses the Yaml string matrix definition.

func (Axis) String added in v0.4.2

func (a Axis) String() string

String returns a string representation of an Axis as a comma-separated list of environment variables.

type Build added in v0.5.0

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

Build represents Docker image build instructions.

func (*Build) UnmarshalYAML added in v0.5.0

func (b *Build) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements custom Yaml unmarshaling.

type Config

type Config struct {
	Image     string
	Build     *Build
	Workspace *Workspace
	Pipeline  []*Container
	Services  []*Container
	Volumes   []*Volume
	Networks  []*Network
}

Config represents the build configuration Yaml document.

func Parse

func Parse(data []byte) (*Config, error)

Parse parses Yaml configuration document.

func ParseString added in v0.5.0

func ParseString(data string) (*Config, error)

ParseString parses the Yaml configuration document.

type Constraint added in v0.5.0

type Constraint struct {
	Include []string
	Exclude []string
}

Constraint defines an individual constraint.

func ParseBranch added in v0.4.2

func ParseBranch(in []byte) Constraint

ParseBranch parses the branch section of the Yaml document.

func ParseBranchString added in v0.4.2

func ParseBranchString(in string) Constraint

ParseBranchString parses the branch section of the Yaml document.

func (*Constraint) Excludes added in v0.5.0

func (c *Constraint) Excludes(v string) bool

Excludes returns true if the string matches matches the exclude patterns.

func (*Constraint) Includes added in v0.5.0

func (c *Constraint) Includes(v string) bool

Includes returns true if the string matches matches the include patterns.

func (*Constraint) Match added in v0.5.0

func (c *Constraint) Match(v string) bool

Match returns true if the string matches the include patterns and does not match any of the exclude patterns.

func (*Constraint) UnmarshalYAML added in v0.5.0

func (c *Constraint) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements custom Yaml unmarshaling.

type ConstraintMap added in v0.5.0

type ConstraintMap struct {
	Include map[string]string
	Exclude map[string]string
}

ConstraintMap defines an individual constraint for key value structures.

func (*ConstraintMap) Match added in v0.5.0

func (c *ConstraintMap) Match(params map[string]string) bool

Match returns true if the params matches the include key values and does not match any of the exclude key values.

func (*ConstraintMap) UnmarshalYAML added in v0.5.0

func (c *ConstraintMap) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements custom Yaml unmarshaling.

type Constraints added in v0.5.0

type Constraints struct {
	Repo        Constraint
	Ref         Constraint
	Platform    Constraint
	Environment Constraint
	Event       Constraint
	Branch      Constraint
	Status      Constraint
	Matrix      ConstraintMap
	Local       types.BoolTrue
}

Constraints define constraints for container execution.

func (*Constraints) Match added in v0.5.0

func (c *Constraints) Match(arch, target, event, branch, status string, matrix map[string]string) bool

Match returns true if all constraints match the given input. If a single constraint fails a false value is returned.

type Container added in v0.5.0

type Container struct {
	ID             string
	Name           string
	Image          string
	Build          string
	Pull           bool
	AuthConfig     Auth
	Detached       bool
	Disabled       bool
	Privileged     bool
	WorkingDir     string
	Environment    map[string]string
	Labels         map[string]string
	Entrypoint     []string
	Command        []string
	Commands       []string
	ExtraHosts     []string
	Volumes        []string
	VolumesFrom    []string
	Devices        []string
	Network        string
	DNS            []string
	DNSSearch      []string
	MemSwapLimit   int64
	MemLimit       int64
	ShmSize        int64
	CPUQuota       int64
	CPUShares      int64
	CPUSet         string
	OomKillDisable bool
	Constraints    Constraints

	Vargs map[string]interface{}
}

Container defines a Docker container.

type Matrix added in v0.4.2

type Matrix map[string][]string

Matrix represents the build matrix.

type Network added in v0.5.0

type Network struct {
	Name       string
	Driver     string
	DriverOpts map[string]string `yaml:"driver_opts"`
}

Network defines a Docker network.

type Volume added in v0.5.0

type Volume struct {
	Name       string
	Driver     string
	DriverOpts map[string]string `yaml:"driver_opts"`
	External   bool
}

Volume defines a Docker volume.

type Workspace added in v0.5.0

type Workspace struct {
	Base string
	Path string
}

Workspace represents the build workspace.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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