engine

package
v0.0.0-...-4c964c4 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2025 License: Apache-2.0 Imports: 24 Imported by: 0

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.

func New

func New(client client.APIClient, opts Opts) *Docker

New returns a new engine.

func NewEnv

func NewEnv(opts Opts) (*Docker, error)

NewEnv returns a new Engine from the environment.

func (*Docker) Destroy

func (e *Docker) Destroy(ctx context.Context, specv runtime.Spec) error

Destroy the pipeline environment.

func (*Docker) Ping

func (e *Docker) Ping(ctx context.Context) error

Ping pings the Docker daemon.

func (*Docker) Run

func (e *Docker) Run(ctx context.Context, specv runtime.Spec, stepv runtime.Step, output io.Writer) (*runtime.State, error)

Run runs the pipeline step.

func (*Docker) Setup

func (e *Docker) Setup(ctx context.Context, specv runtime.Spec) error

Setup the pipeline environment.

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 Opts

type Opts struct {
	HidePull bool
}

Opts configures the Docker engine.

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 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 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.

func (*Secret) GetName

func (s *Secret) GetName() string

func (*Secret) GetValue

func (s *Secret) GetValue() string

func (*Secret) IsMasked

func (s *Secret) IsMasked() bool

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.

func (*Spec) StepAt

func (s *Spec) StepAt(i int) runtime.Step

func (*Spec) StepLen

func (s *Spec) StepLen() int

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"`
	CPUShares    int64             `json:"cpu_shares,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    runtime.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    runtime.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"`
}

Step defines a pipeline step.

func (*Step) Clone

func (s *Step) Clone() runtime.Step

func (*Step) GetDependencies

func (s *Step) GetDependencies() []string

func (*Step) GetEnviron

func (s *Step) GetEnviron() map[string]string

func (*Step) GetErrPolicy

func (s *Step) GetErrPolicy() runtime.ErrPolicy

func (*Step) GetImage

func (s *Step) GetImage() string

func (*Step) GetName

func (s *Step) GetName() string

func (*Step) GetRunPolicy

func (s *Step) GetRunPolicy() runtime.RunPolicy

func (*Step) GetSecretAt

func (s *Step) GetSecretAt(i int) runtime.Secret

func (*Step) GetSecretLen

func (s *Step) GetSecretLen() int

func (*Step) IsDetached

func (s *Step) IsDetached() bool

func (*Step) SetEnviron

func (s *Step) SetEnviron(env map[string]string)

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

type VolumeMount struct {
	Name string `json:"name,omitempty"`
	Path string `json:"path,omitempty"`
}

VolumeMount describes a mounting of a Volume within a container.

Directories

Path Synopsis
shell
Package shell provides functions for converting shell commands to posix shell scripts.
Package shell provides functions for converting shell commands to posix shell scripts.
shell/powershell
Package powershell provides functions for converting shell commands to powershell scripts.
Package powershell provides functions for converting shell commands to powershell scripts.

Jump to

Keyboard shortcuts

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