Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Auth ¶
type Auth struct {
Address string `json:"address,omitempty"`
Username string `json:"username,omitempty"`
Password string `json:"password,omitempty"`
}
Auth defines dockerhub authentication credentials.
type Docker ¶
type Docker struct {
// contains filtered or unexported fields
}
Docker implements a Docker pipeline engine.
type Engine ¶
type Engine interface {
// Setup the pipeline environment.
Setup(context.Context, *Spec) error
// Destroy the pipeline environment.
Destroy(context.Context, *Spec) error
// Run runs the pipeline step.
Run(context.Context, *Spec, *Step, io.Writer) (*State, error)
}
Engine is the interface that must be implemented by a pipeline execution engine.
type ErrPolicy ¶
type ErrPolicy int
ErrPolicy defines the step error policy
func (*ErrPolicy) MarshalJSON ¶
MarshalJSON marshals the string representation of the pull type to JSON.
func (*ErrPolicy) UnmarshalJSON ¶
UnmarshalJSON unmarshals the json representation of the pull type from a string value.
type Network ¶
type Network struct {
ID string `json:"id,omitempty"`
Labels map[string]string `json:"labels,omitempty"`
Options map[string]string `json:"options,omitempty"`
}
Network that is created and attached to containers
type PullPolicy ¶
type PullPolicy int
PullPolicy defines the container image pull policy.
const ( PullDefault PullPolicy = iota PullAlways PullIfNotExists PullNever )
PullPolicy enumeration.
func (*PullPolicy) MarshalJSON ¶
func (p *PullPolicy) MarshalJSON() ([]byte, error)
MarshalJSON marshals the string representation of the pull type to JSON.
func (PullPolicy) String ¶
func (p PullPolicy) String() string
func (*PullPolicy) UnmarshalJSON ¶
func (p *PullPolicy) UnmarshalJSON(b []byte) error
UnmarshalJSON unmarshals the json representation of the pull type from a string value.
type RunPolicy ¶
type RunPolicy int
RunPolicy defines the policy for starting containers based on the point-in-time pass or fail state of the pipeline.
func (*RunPolicy) MarshalJSON ¶
MarshalJSON marshals the string representation of the run type to JSON.
func (*RunPolicy) UnmarshalJSON ¶
UnmarshalJSON unmarshals the json representation of the run type from a string value.
type Secret ¶
type Secret struct {
Name string `json:"name,omitempty"`
Env string `json:"env,omitempty"`
Data []byte `json:"data,omitempty"`
Mask bool `json:"mask,omitempty"`
}
Secret represents a secret variable.
type Spec ¶
type Spec struct {
Platform Platform `json:"platform,omitempty"`
Steps []*Step `json:"steps,omitempty"`
Internal []*Step `json:"internal,omitempty"`
Volumes []*Volume `json:"volumes,omitempty"`
Network Network `json:"network"`
}
Spec provides the pipeline spec. This provides the required instructions for reproducible pipeline execution.
type State ¶
type State struct {
// ExitCode returns the exit code of the exited step.
ExitCode int
// GetExited reports whether the step has exited.
Exited bool
// OOMKilled reports whether the step has been
// killed by the process manager.
OOMKilled bool
}
State reports the execution state.
type Step ¶
type Step struct {
ID string `json:"id,omitempty"`
Auth *Auth `json:"auth,omitempty"`
Command []string `json:"args,omitempty"`
CPUPeriod int64 `json:"cpu_period,omitempty"`
CPUQuota int64 `json:"cpu_quota,omitempty"`
CPUSet []string `json:"cpu_set,omitempty"`
Detach bool `json:"detach,omitempty"`
DependsOn []string `json:"depends_on,omitempty"`
Devices []*VolumeDevice `json:"devices,omitempty"`
DNS []string `json:"dns,omitempty"`
DNSSearch []string `json:"dns_search,omitempty"`
Entrypoint []string `json:"entrypoint,omitempty"`
Envs map[string]string `json:"environment,omitempty"`
ErrPolicy ErrPolicy `json:"err_policy,omitempty"`
ExtraHosts []string `json:"extra_hosts,omitempty"`
IgnoreStdout bool `json:"ignore_stderr,omitempty"`
IgnoreStderr bool `json:"ignore_stdout,omitempty"`
Image string `json:"image,omitempty"`
Labels map[string]string `json:"labels,omitempty"`
MemSwapLimit int64 `json:"memswap_limit,omitempty"`
MemLimit int64 `json:"mem_limit,omitempty"`
Name string `json:"name,omitempty"`
Network string `json:"network,omitempty"`
Networks []string `json:"networks,omitempty"`
Privileged bool `json:"privileged,omitempty"`
Pull PullPolicy `json:"pull,omitempty"`
RunPolicy RunPolicy `json:"run_policy,omitempty"`
Secrets []*Secret `json:"secrets,omitempty"`
ShmSize int64 `json:"shm_size,omitempty"`
User string `json:"user,omitempty"`
Volumes []*VolumeMount `json:"volumes,omitempty"`
WorkingDir string `json:"working_dir,omitempty"`
Display string
}
Step defines a pipeline step.
type Volume ¶
type Volume struct {
EmptyDir *VolumeEmptyDir `json:"temp,omitempty"`
HostPath *VolumeHostPath `json:"host,omitempty"`
}
Volume that can be mounted by containers.
type VolumeDevice ¶
type VolumeDevice struct {
Name string `json:"name,omitempty"`
DevicePath string `json:"path,omitempty"`
}
VolumeDevice describes a mapping of a raw block device within a container.
type VolumeEmptyDir ¶
type VolumeEmptyDir struct {
ID string `json:"id,omitempty"`
Name string `json:"name,omitempty"`
Medium string `json:"medium,omitempty"`
SizeLimit int64 `json:"size_limit,omitempty"`
Labels map[string]string `json:"labels,omitempty"`
}
VolumeEmptyDir mounts a temporary directory from the host node's filesystem into the container. This can be used as a shared scratch space.
type VolumeHostPath ¶
type VolumeHostPath struct {
ID string `json:"id,omitempty"`
Name string `json:"name,omitempty"`
Path string `json:"path,omitempty"`
Labels map[string]string `json:"labels,omitempty"`
ReadOnly bool `json:"read_only,omitempty"`
}
VolumeHostPath mounts a file or directory from the host node's filesystem into your container.
type VolumeMount ¶
VolumeMount describes a mounting of a Volume within a container.