Documentation
¶
Index ¶
Constants ¶
const (
// DefaultNetworkName is the default network name.
DefaultNetworkName = "acb_default_network"
)
const (
// ImmediateExecutionToken defines the when dependency to indicate a step should execute immediately.
ImmediateExecutionToken = "-"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dag ¶
Dag represents a thread safe directed acyclic graph.
func NewDagFromTask ¶ added in v1.0.5
NewDagFromTask creates a new Dag based on the specified Task.
type Network ¶ added in v1.0.7
type Network struct {
Name string `yaml:"name"`
Ipv6 bool `yaml:"ipv6"`
Driver string `yaml:"driver"`
SkipCreation bool `yaml:"skipCreation"`
IsDefault bool `yaml:"isDefault"`
}
Network defines a Docker network.
func NewNetwork ¶ added in v1.0.7
NewNetwork creates a new network.
func (*Network) Create ¶ added in v1.0.7
func (n *Network) Create(ctx context.Context, pm *procmanager.ProcManager) (string, error)
Create creates a new Docker network.
func (*Network) Delete ¶ added in v1.0.7
func (n *Network) Delete(ctx context.Context, pm *procmanager.ProcManager) (string, error)
Delete deletes the Docker network.
type Node ¶
Node represents a vertex in a Dag.
type Secret ¶
type Secret struct {
Akv string `yaml:"akv,omitempty"`
SecretEnv string `yaml:"secretEnv,omitempty"`
}
Secret defines a wrapper to translate Azure Key Vault secrets to environment variables.
type SelfReferencedStepError ¶
type SelfReferencedStepError struct {
// contains filtered or unexported fields
}
SelfReferencedStepError defines an error to be returned if the Step is self-referenced.
func NewSelfReferencedStepError ¶
func NewSelfReferencedStepError(message string) *SelfReferencedStepError
NewSelfReferencedStepError creates a new SelfReferencedStepError with the specified message.
func (*SelfReferencedStepError) Error ¶
func (e *SelfReferencedStepError) Error() string
Error returns the error message for a SelfReferencedStepError.
type Step ¶
type Step struct {
ID string `yaml:"id"`
Cmd string `yaml:"cmd"`
Build string `yaml:"build"`
Push []string `yaml:"push"`
WorkingDirectory string `yaml:"workingDirectory"`
EntryPoint string `yaml:"entryPoint"`
Envs []string `yaml:"env"`
SecretEnvs []string `yaml:"secretEnvs"`
Expose []string `yaml:"expose"`
Ports []string `yaml:"ports"`
When []string `yaml:"when"`
ExitedWith []int `yaml:"exitedWith"`
ExitedWithout []int `yaml:"exitedWithout"`
Timeout int `yaml:"timeout"`
Keep bool `yaml:"keep"`
Detach bool `yaml:"detach"`
StartDelay int `yaml:"startDelay"`
Privileged bool `yaml:"privileged"`
User string `yaml:"user"`
Network string `yaml:"network"`
Isolation string `yaml:"isolation"`
IgnoreErrors bool `yaml:"ignoreErrors"`
Retries int `yaml:"retries"`
RetryDelayInSeconds int `yaml:"retryDelay"`
DisableWorkingDirectoryOverride bool `yaml:"disableWorkingDirectoryOverride"`
StartTime time.Time
EndTime time.Time
StepStatus StepStatus
// CompletedChan can be used to signal to readers
// that the step has been processed.
CompletedChan chan bool
ImageDependencies []*image.Dependencies
Tags []string
BuildArgs []string
}
Step is a step in the execution task.
func (*Step) IsBuildStep ¶
IsBuildStep returns true if the Step is a build step, false otherwise.
func (*Step) IsCmdStep ¶ added in v1.0.7
IsCmdStep returns true if the Step is a command step, false otherwise.
func (*Step) IsPushStep ¶ added in v1.0.7
IsPushStep returns true if a Step is a push step, false otherwise.
func (*Step) ShouldExecuteImmediately ¶
ShouldExecuteImmediately returns true if the Step should be executed immediately.
func (*Step) UpdateBuildStepWithDefaults ¶ added in v1.0.9
func (s *Step) UpdateBuildStepWithDefaults()
UpdateBuildStepWithDefaults updates a build step with hyperv isolation on Windows.
type StepStatus ¶
type StepStatus string
StepStatus is an enum for step statuses.
const ( // InProgress means the step is being processed. InProgress StepStatus = "inprogress" // Successful means the step completed and was successful. Successful StepStatus = "successful" // Skipped means the step has been skipped. Skipped StepStatus = "skipped" // Failed means the step failed because of an error. Failed StepStatus = "failed" )
type Task ¶ added in v1.0.5
type Task struct {
Steps []*Step `yaml:"steps"`
StepTimeout int `yaml:"stepTimeout,omitempty"`
TotalTimeout int `yaml:"totalTimeout,omitempty"`
Secrets []*Secret `yaml:"secrets,omitempty"`
Networks []*Network `yaml:"networks,omitempty"`
WorkingDirectory string `yaml:"workingDirectory,omitempty"`
Version string `yaml:"version,omitempty"`
RegistryName string
RegistryUsername string
RegistryPassword string
Dag *Dag
IsBuildTask bool // Used to skip the default network creation for build.
Envs []string `yaml:"envs,omitempty"`
}
Task represents a task execution.
func NewTask ¶ added in v1.0.5
func NewTask( steps []*Step, secrets []*Secret, registry string, user string, pw string, isBuildTask bool) (*Task, error)
NewTask returns a default Task object.
func UnmarshalTaskFromFile ¶ added in v1.0.5
UnmarshalTaskFromFile unmarshals a Task from a file.
func UnmarshalTaskFromString ¶ added in v1.0.5
func UnmarshalTaskFromString(data, registry, user, pw, defaultWorkDir, network string, envs []string) (*Task, error)
UnmarshalTaskFromString unmarshals a Task from a raw string.
func (*Task) UsingRegistryCreds ¶ added in v1.0.5
UsingRegistryCreds determines whether or not the Task is using registry creds.