Documentation ¶
Index ¶
- type DockerAuth
- type DockerConfig
- type DockerStep
- type Engine
- type File
- type FileMount
- type FusionConfig
- type Metadata
- type Platform
- type Port
- type PullPolicy
- type QemuConfig
- type ResourceObject
- type Resources
- type RunPolicy
- type Secret
- type SecretVar
- type Spec
- type State
- type Step
- type Volume
- type VolumeDevice
- type VolumeEmptyDir
- type VolumeHostPath
- type VolumeMount
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DockerAuth ¶
type DockerAuth struct { Address string `json:"address,omitempty"` Username string `json:"username,omitempty"` Password string `json:"password,omitempty"` }
DockerAuth defines dockerhub authentication credentials.
func LookupAuth ¶
func LookupAuth(spec *Spec, domain string) (*DockerAuth, bool)
LookupAuth is a helper function that will lookup the docker credentials by hostname.
type DockerConfig ¶
type DockerConfig struct { Auths []*DockerAuth `json:"auths,omitempty"` Volumes []*Volume `json:"volumes,omitempty"` }
DockerConfig configures a Docker-based pipeline.
type DockerStep ¶
type DockerStep struct { Args []string `json:"args,omitempty"` Command []string `json:"command,omitempty"` DNS []string `json:"dns,omitempty"` DNSSearch []string `json:"dns_search,omitempty"` ExtraHosts []string `json:"extra_hosts,omitempty"` Image string `json:"image,omitempty"` Network string `json:"network,omitempty"` Networks []string `json:"networks,omitempty"` Ports []*Port `json:"ports,omitempty"` Privileged bool `json:"privileged,omitempty"` PullPolicy PullPolicy `json:"pull_policy,omitempty"` User string `json:"user"` }
DockerStep configures a docker step.
type Engine ¶
type Engine interface { // Setup the pipeline environment. Setup(context.Context, *Spec) error // Create creates the pipeline state. Create(context.Context, *Spec, *Step) error // Start the pipeline step. Start(context.Context, *Spec, *Step) error // Wait for the pipeline step to complete and returns the completion results. Wait(context.Context, *Spec, *Step) (*State, error) // Tail the pipeline step logs. Tail(context.Context, *Spec, *Step) (io.ReadCloser, error) // Destroy the pipeline environment. Destroy(context.Context, *Spec) error }
Engine defines a runtime engine for pipeline execution.
type File ¶
type File struct { Metadata Metadata `json:"metadata,omitempty"` Data []byte `json:"data,omitempty"` }
File defines a file that should be uploaded or mounted somewhere in the step container or virtual machine prior to command execution.
type FileMount ¶
type FileMount struct { Name string `json:"name,omitempty"` Path string `json:"path,omitempty"` Mode int64 `json:"mode,omitempty"` }
FileMount defines how a file resource should be mounted or included in the runtime environment.
type FusionConfig ¶
type FusionConfig struct {
Image string `json:"image,omitempty"`
}
FusionConfig configures a VMWare Fusion-based pipeline.
type Metadata ¶
type Metadata struct { UID string `json:"uid,omitempty"` Namespace string `json:"namespace,omitempty"` Name string `json:"name,omitempty"` Labels map[string]string `json:"labels,omitempty"` }
Metadata provides execution metadata.
type Platform ¶
type Platform struct { OS string `json:"os,omitempty"` Arch string `json:"arch,omitempty"` Variant string `json:"variant,omitempty"` Version string `json:"version,omitempty"` }
Platform defines the target platform.
type Port ¶
type Port struct { Port int `json:"port,omitempty"` Host int `json:"host,omitempty"` Protocol string `json:"protocol,omitempty"` }
Port represents a network port in a single container.
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 QemuConfig ¶
type QemuConfig struct {
Image string `json:"image,omitempty"`
}
QemuConfig configures a Qemu-based pipeline.
type ResourceObject ¶
type ResourceObject struct { CPU int64 `json:"cpu,omitempty"` Memory int64 `json:"memory,omitempty"` }
ResourceObject describes compute resource requirements.
type Resources ¶
type Resources struct { // Limits describes the maximum amount of compute // resources allowed. Limits *ResourceObject `json:"limits,omitempty"` // Requests describes the minimum amount of // compute resources required. Requests *ResourceObject `json:"requests,omitempty"` }
Resources describes the compute resource requirements.
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 { Metadata Metadata `json:"metadata,omitempty"` Data string `json:"data,omitempty"` }
Secret represents a secret variable.
type Spec ¶
type Spec struct { Metadata Metadata `json:"metadata,omitempty"` Platform Platform `json:"platform,omitempty"` Secrets []*Secret `json:"secrets,omitempty"` Steps []*Step `json:"steps,omitempty"` Files []*File `json:"files,omitempty"` // Docker-specific settings. These settings are // only used by the Docker and Kubernetes runtime // drivers. Docker *DockerConfig `json:"docker,omitempty"` // Qemu-specific settings. These settings are only // used by the qemu runtime driver. Qemu *QemuConfig `json:"qemu,omitempty"` // VMWare Fusion settings. These settings are only // used by the VMWare runtime driver. Fusion *FusionConfig `json:"fusion,omitempty"` }
Spec provides the pipeline spec. This provides the required instructions for reproducable pipeline execution.
func ParseString ¶
ParseString parses the pipeline config from a string.
type State ¶
type State struct { ExitCode int // Container exit code Exited bool // Container exited OOMKilled bool // Container is oom killed }
State represents the container state.
type Step ¶
type Step struct { Metadata Metadata `json:"metadata,omitempty"` Detach bool `json:"detach,omitempty"` DependsOn []string `json:"depends_on,omitempty"` Devices []*VolumeDevice `json:"devices,omitempty"` Envs map[string]string `json:"environment,omitempty"` Files []*FileMount `json:"files,omitempty"` IgnoreErr bool `json:"ignore_err,omitempty"` IgnoreStdout bool `json:"ignore_stderr,omitempty"` IgnoreStderr bool `json:"ignore_stdout,omitempty"` Resources *Resources `json:"resources,omitempty"` RunPolicy RunPolicy `json:"run_policy,omitempty"` Secrets []*SecretVar `json:"secrets,omitempty"` Volumes []*VolumeMount `json:"volumes,omitempty"` WorkingDir string `json:"working_dir,omitempty"` // Docker-specific settings. These settings are // only used by the Docker and Kubernetes runtime // drivers. Docker *DockerStep `json:"docker,omitempty"` }
Step defines a pipeline step.
type Volume ¶
type Volume struct { Metadata Metadata `json:"metadata,omitempty"` 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 { Medium string `json:"medium,omitempty"` SizeLimit int64 `json:"size_limit,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 {
Path string `json:"path,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.