yaml

package
v1.2.5 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Convert

func Convert(d []byte, remote string) ([]byte, error)

Convert converts the yaml configuration file from the legacy format to the 1.0+ format.

Types

type Config

type Config struct {
	Workspace struct {
		Base string
		Path string
	}
	Clone    Containers
	Pipeline Containers
	Services Containers
	Branches Constraint
	Matrix   interface{}
	Secrets  map[string]struct {
		Driver     string
		DriverOpts map[string]string `yaml:"driver_opts"`
		Path       string
		Vault      string
	}
}

Config provides the high-level configuration.

type Constraint

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

Constraint defines a runtime constraint.

func (*Constraint) UnmarshalYAML

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

UnmarshalYAML unmarshals the constraint.

type ConstraintMap

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

ConstraintMap defines a runtime constraint map.

func (*ConstraintMap) UnmarshalYAML

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

UnmarshalYAML unmarshals the constraint map.

type Constraints

type Constraints struct {
	Ref         Constraint
	Repo        Constraint
	Instance    Constraint
	Environment Constraint
	Event       Constraint
	Branch      Constraint
	Status      Constraint
	Matrix      map[string]string
}

Constraints defines a set of runtime constraints.

type Container

type Container struct {
	Command     StringSlice            `yaml:"command,omitempty"`
	Commands    StringSlice            `yaml:"commands,omitempty"`
	Detached    bool                   `yaml:"detach,omitempty"`
	Devices     []string               `yaml:"devices,omitempty"`
	ErrIgnore   bool                   `yaml:"allow_failure,omitempty"`
	Tmpfs       []string               `yaml:"tmpfs,omitempty"`
	DNS         StringSlice            `yaml:"dns,omitempty"`
	DNSSearch   StringSlice            `yaml:"dns_search,omitempty"`
	Entrypoint  StringSlice            `yaml:"entrypoint,omitempty"`
	Environment SliceMap               `yaml:"environment,omitempty"`
	ExtraHosts  []string               `yaml:"extra_hosts,omitempty"`
	Image       string                 `yaml:"image,omitempty"`
	Name        string                 `yaml:"name,omitempty"`
	Privileged  bool                   `yaml:"privileged,omitempty"`
	Pull        bool                   `yaml:"pull,omitempty"`
	Shell       string                 `yaml:"shell,omitempty"`
	Volumes     []*Volume              `yaml:"volumes,omitempty"`
	Secrets     Secrets                `yaml:"secrets,omitempty"`
	Constraints Constraints            `yaml:"when,omitempty"`
	Vargs       map[string]interface{} `yaml:",inline"`
}

Container represents a Docker container.

type Containers

type Containers struct {
	Containers []*Container
}

Containers represents an ordered list of containers.

func (*Containers) UnmarshalYAML

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

UnmarshalYAML implements the Unmarshaller interface.

type Secret

type Secret struct {
	Source string
	Target string
}

Secret represents a container secret.

type Secrets

type Secrets struct {
	Secrets []*Secret
}

Secrets represents a list of container secrets.

func (*Secrets) UnmarshalYAML

func (s *Secrets) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements the Unmarshaller interface.

type SliceMap

type SliceMap struct {
	Map map[string]string
}

SliceMap represents a slice or map of key pairs.

func (*SliceMap) UnmarshalYAML

func (s *SliceMap) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements custom Yaml unmarshaling.

type StringSlice

type StringSlice []string

StringSlice represents a slice of strings or a string.

func (*StringSlice) UnmarshalYAML

func (s *StringSlice) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements the Unmarshaller interface.

type Volume

type Volume struct {
	Source      string
	Destination string
	ReadOnly    bool
}

Volume represent a container volume.

func (*Volume) UnmarshalYAML

func (v *Volume) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements the Unmarshaller interface.

Jump to

Keyboard shortcuts

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