Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Concurrency ¶ added in v3.16.0
type Concurrency struct {
// Limit is the maximum number of workflows sharing the same group that
// are allowed to run at the same time. A value <= 0 disables the limit.
Limit int `yaml:"limit,omitempty"`
// Group identifies which workflows are mutually limited. Workflows that
// resolve to the same group within a repository are serialized according
// to the limit. When empty the limit applies per workflow, so different
// runs of the same workflow are limited against each other.
Group string `yaml:"group,omitempty"`
}
Concurrency limits how many instances of a workflow may run at the same time. It can be unmarshaled from:
- an integer: `concurrency: 1` (limit only, default per-workflow group)
- an object: `concurrency: {limit: 1, group: deploy}`
func (Concurrency) IsZero ¶ added in v3.16.0
func (c Concurrency) IsZero() bool
IsZero treats a disabled (limit <= 0) concurrency as empty for omitempty.
func (Concurrency) MarshalYAML ¶ added in v3.16.0
func (c Concurrency) MarshalYAML() (any, error)
MarshalYAML implements the Marshaler interface. It mirrors UnmarshalYAML so the config round-trips: when only a limit is set (no explicit group) it emits the shorthand `concurrency: <int>`, otherwise the full `{limit, group}` form.
func (*Concurrency) UnmarshalYAML ¶ added in v3.16.0
func (c *Concurrency) UnmarshalYAML(value *yaml.Node) error
UnmarshalYAML implements the Unmarshaler interface. It inspects the YAML node kind to decide how to decode, instead of speculatively decoding into an int and falling back on error:
- a scalar (`concurrency: 1`) sets only the limit
- a mapping (`concurrency: {limit: 1, group: deploy}`) sets both fields
type Container ¶
type Container struct {
// common
Name string `yaml:"name,omitempty"`
Image string `yaml:"image,omitempty"`
Pull bool `yaml:"pull,omitempty"`
Commands base.StringOrSlice `yaml:"commands,omitempty"`
Entrypoint base.StringOrSlice `yaml:"entrypoint,omitempty"`
Directory string `yaml:"directory,omitempty"`
Settings map[string]any `yaml:"settings,omitempty"`
Environment map[string]any `yaml:"environment,omitempty"`
// flow control
DependsOn constraint.DependsOn `yaml:"depends_on,omitempty"`
When constraint.When `yaml:"when,omitempty"`
Failure string `yaml:"failure,omitempty"`
Detached bool `yaml:"detach,omitempty"`
// state
Volumes Volumes `yaml:"volumes,omitempty"`
// network
Ports []string `yaml:"ports,omitempty"`
DNS base.StringOrSlice `yaml:"dns,omitempty"`
DNSSearch base.StringOrSlice `yaml:"dns_search,omitempty"`
// backend specific
BackendOptions map[string]any `yaml:"backend_options,omitempty"`
// Docker and Kubernetes Specific
Privileged bool `yaml:"privileged,omitempty"`
// Undocumented
Devices []string `yaml:"devices,omitempty"`
ExtraHosts []string `yaml:"extra_hosts,omitempty"`
NetworkMode string `yaml:"network_mode,omitempty"`
Tmpfs []string `yaml:"tmpfs,omitempty"`
}
Container defines a container.
func (*Container) IsTrustedCloneImage ¶
type ContainerList ¶
type ContainerList struct {
ContainerList []*Container
}
ContainerList contains ordered collection of containers.
func (ContainerList) MarshalYAML ¶ added in v3.12.0
func (c ContainerList) MarshalYAML() (any, error)
MarshalYAML implements custom Yaml marshaling.
func (*ContainerList) UnmarshalYAML ¶
func (c *ContainerList) UnmarshalYAML(value *yaml.Node) error
UnmarshalYAML implements the Unmarshaler interface.
type Network ¶
type Network struct {
Name string `yaml:"-"`
Aliases []string `yaml:"aliases,omitempty"`
IPv4Address string `yaml:"ipv4_address,omitempty"`
IPv6Address string `yaml:"ipv6_address,omitempty"`
}
Network represents a service network in compose file.
type Networks ¶
type Networks struct {
Networks []*Network
}
Networks represents a list of service networks in compose file. It has several representation, hence this specific struct.
func (Networks) MarshalYAML ¶
MarshalYAML implements the Marshaller interface.
type Volume ¶
type Volume struct {
Source string `yaml:"-"`
Destination string `yaml:"-"`
AccessMode string `yaml:"-"`
}
Volume represent a service volume.
type Volumes ¶
type Volumes struct {
Volumes []*Volume
}
Volumes represents a list of service volumes in compose file. It has several representation, hence this specific struct.
func (Volumes) MarshalYAML ¶
MarshalYAML implements the Marshaller interface.
type Workflow ¶
type Workflow struct {
When constraint.When `yaml:"when,omitempty"`
Workspace Workspace `yaml:"workspace,omitempty"`
Clone ContainerList `yaml:"clone,omitempty"`
Steps ContainerList `yaml:"steps,omitempty"`
Services ContainerList `yaml:"services,omitempty"`
Labels map[string]string `yaml:"labels,omitempty"`
DependsOn constraint.DependsOn `yaml:"depends_on,omitempty"`
Concurrency Concurrency `yaml:"concurrency,omitempty"`
SkipClone bool `yaml:"skip_clone,omitempty"`
// Deprecated: use when.status. TODO remove in next major.
RunsOn []string `yaml:"runs_on,omitempty"`
}
Workflow defines a workflow configuration.