Documentation ¶
Index ¶
- Constants
- func GetAddressAuthTokensMap(dockerRegistries []DockerRegistry) (r map[string]string)
- func GetAuthConfigsMap(dockerRegistries []DockerRegistry) map[string]types.AuthConfig
- func GetGlobalParams(writer io.Writer, projectRoot, branch string) (map[string]Parameter, error)
- type BackupResolver
- type BaseStep
- func (bS *BaseStep) GetDescription() string
- func (bS *BaseStep) GetID() string
- func (bS *BaseStep) GetOutputStreams() []*Stream
- func (bS *BaseStep) GetStreamID(streamName string) (string, error)
- func (bS *BaseStep) GetStreamWriter(emitter Emitter, streamName string) (StreamWriter, error)
- func (bS *BaseStep) GetType() string
- type BlankEmitter
- type BlankWriter
- type ConstructionPlan
- type DockerRegistry
- type Emitter
- type Parameter
- type Setup
- type Stage
- type Step
- type StepDockerBuild
- type StepDockerCompose
- func (dC *StepDockerCompose) Execute(emitter Emitter, t *Task) error
- func (dC StepDockerCompose) GetDetails() string
- func (dC *StepDockerCompose) SetParams(params map[string]*Parameter) error
- func (dC *StepDockerCompose) Stop() error
- func (dC *StepDockerCompose) Validate(params map[string]Parameter) error
- type StepDockerPush
- type StepDockerRun
- type StepWriter
- type Stoppable
- type Stream
- type StreamLine
- type StreamWriter
- type Task
- type TaskDocker
- type TaskWriter
Constants ¶
View Source
const ( StateWaiting = "waiting" StateBuilding = "building" StateSuccess = "succeeded" StateFailed = "failed" )
Step state constants
View Source
const ( EventBuildStart = "BUILD_START" EventTaskStart = "TASK_START" EventStepStart = "STEP_START" EventStepComplete = "STEP_COMPLETE" // fires regardless of success/fail EventStepSuccess = "STEP_SUCCESS" EventStepFail = "STEP_FAIL" EventTaskComplete = "TASK_COMPLETE" // fires regardless of success/fail EventTaskSuccess = "TASK_SUCCESS" EventTaskFail = "TASK_FAIL" EventBuildComplete = "BUILD_COMPLETE" // fires regardless of success/fail EventBuildSuccess = "BUILD_SUCCESS" EventBuildFail = "BUILD_FAIL" )
Event constants for Task_* we can add a modifier to specify *which* task e.g. TASK_COMPLETE-<task_name> for Step_* we can add a modifier to specify *which* step (in the currently building task) e.g. STEP_COMPLETE-<step_name>
Variables ¶
This section is empty.
Functions ¶
func GetAddressAuthTokensMap ¶
func GetAddressAuthTokensMap(dockerRegistries []DockerRegistry) (r map[string]string)
func GetAuthConfigsMap ¶
func GetAuthConfigsMap(dockerRegistries []DockerRegistry) map[string]types.AuthConfig
Types ¶
type BackupResolver ¶
type BaseStep ¶
type BaseStep struct { ID string `json:"id"` Type string `json:"type" yaml:"type"` Description string `json:"description" yaml:"description"` OutputStreams []*Stream `json:"outputStreams" yaml:"-"` Status string `json:"status"` StartedAt *time.Time `json:"startedAt"` UpdatedAt *time.Time `json:"updatedAt"` CompletedAt *time.Time `json:"completedAt"` }
func (*BaseStep) GetDescription ¶
func (*BaseStep) GetOutputStreams ¶
func (*BaseStep) GetStreamWriter ¶
func (bS *BaseStep) GetStreamWriter(emitter Emitter, streamName string) (StreamWriter, error)
type BlankEmitter ¶
type BlankEmitter struct { }
func NewBlankEmitter ¶
func NewBlankEmitter() *BlankEmitter
func (*BlankEmitter) GetStepWriter ¶
func (w *BlankEmitter) GetStepWriter(Step) StepWriter
func (*BlankEmitter) GetStreamWriter ¶
func (w *BlankEmitter) GetStreamWriter(*Stream) StreamWriter
func (*BlankEmitter) GetTaskWriter ¶
func (w *BlankEmitter) GetTaskWriter(*Task) TaskWriter
type BlankWriter ¶
type BlankWriter struct { }
func (BlankWriter) Close ¶
func (w BlankWriter) Close()
func (BlankWriter) SetStatus ¶
func (w BlankWriter) SetStatus(s string)
type ConstructionPlan ¶
type ConstructionPlan struct { ID string `json:"id"` Name string `json:"name"` Stages []*Stage `json:"stages"` }
ConstructionPlan represents a collection of Stages to be executed in order.
func NewConstructionPlanFromBlueprint ¶
func NewConstructionPlanFromBlueprint( targetBlueprintName string, blueprints []*config.Blueprint, paramResolver BackupResolver, repository *git.Repository, branch string, commitSha string, projectRoot string, ) (*ConstructionPlan, error)
func NewConstructionPlanFromPipeline ¶
func NewConstructionPlanFromPipeline( targetPipelineName string, pipelines []*config.Pipeline, blueprints []*config.Blueprint, paramResolver BackupResolver, repository *git.Repository, branch string, commitSha string, projectRoot string, ) (*ConstructionPlan, error)
func (*ConstructionPlan) Execute ¶
func (p *ConstructionPlan) Execute(emitter Emitter) error
func (*ConstructionPlan) Stop ¶
func (p *ConstructionPlan) Stop() error
type DockerRegistry ¶
type Emitter ¶
type Emitter interface { GetStreamWriter(*Stream) StreamWriter GetStepWriter(Step) StepWriter GetTaskWriter(*Task) TaskWriter }
Emitter for forwarding bytes of output onwards
type Setup ¶
type Setup struct { BaseStep // contains filtered or unexported fields }
func NewStepSetup ¶
func NewStepSetup( resolver BackupResolver, repository *git.Repository, branch, commitSha string, ) *Setup
func (Setup) GetDetails ¶
type Stage ¶
type Stage struct { ID string `json:"id"` Index uint16 `json:"index"` Status string `json:"status"` // k: Task.ID Tasks map[string]*Task `json:"tasks"` }
Stage represents a set of Tasks that can run in parallel, therefore Tasks is a map[TaskID]Task.
type StepDockerBuild ¶
type StepDockerBuild struct { BaseStep Dockerfile string `json:"dockerfile"` Context string `json:"context"` Tags []string `json:"tags"` // contains filtered or unexported fields }
func NewStepDockerBuild ¶
func NewStepDockerBuild(c *config.StepDockerBuild) *StepDockerBuild
func (*StepDockerBuild) Execute ¶
func (dB *StepDockerBuild) Execute(emitter Emitter, t *Task) error
func (StepDockerBuild) GetDetails ¶
func (dB StepDockerBuild) GetDetails() string
func (*StepDockerBuild) SetParams ¶
func (dB *StepDockerBuild) SetParams(params map[string]*Parameter) error
func (*StepDockerBuild) Stop ¶
func (dB *StepDockerBuild) Stop() error
type StepDockerCompose ¶
type StepDockerCompose struct { BaseStep ComposeFilePath string `json:"composeFile"` // contains filtered or unexported fields }
func NewStepDockerCompose ¶
func NewStepDockerCompose(c *config.StepDockerCompose, projectRoot string) *StepDockerCompose
func (*StepDockerCompose) Execute ¶
func (dC *StepDockerCompose) Execute(emitter Emitter, t *Task) error
func (StepDockerCompose) GetDetails ¶
func (dC StepDockerCompose) GetDetails() string
func (*StepDockerCompose) SetParams ¶
func (dC *StepDockerCompose) SetParams(params map[string]*Parameter) error
func (*StepDockerCompose) Stop ¶
func (dC *StepDockerCompose) Stop() error
type StepDockerPush ¶
type StepDockerPush struct { BaseStep Tags []string `json:"tags"` // contains filtered or unexported fields }
func NewStepDockerPush ¶
func NewStepDockerPush(c *config.StepDockerPush) *StepDockerPush
func (*StepDockerPush) Execute ¶
func (dP *StepDockerPush) Execute(emitter Emitter, tsk *Task) error
func (StepDockerPush) GetDetails ¶
func (dP StepDockerPush) GetDetails() string
func (*StepDockerPush) SetParams ¶
func (dP *StepDockerPush) SetParams(params map[string]*Parameter) error
func (*StepDockerPush) Stop ¶
func (dP *StepDockerPush) Stop() error
type StepDockerRun ¶
type StepDockerRun struct { BaseStep Image string `json:"image"` Command []string `json:"command"` Environment map[string]string `json:"environment"` WorkingDir string `json:"workingDir"` MountPoint string `json:"mountPoint"` IgnoreExitCode bool `json:"ignoreExitCode"` // contains filtered or unexported fields }
func NewStepDockerRun ¶
func NewStepDockerRun(c *config.StepDockerRun) *StepDockerRun
func (StepDockerRun) GetDetails ¶
func (dR StepDockerRun) GetDetails() string
func (*StepDockerRun) SetParams ¶
func (dR *StepDockerRun) SetParams(params map[string]*Parameter) error
func (*StepDockerRun) Stop ¶
func (dR *StepDockerRun) Stop() error
type StepWriter ¶
type StreamLine ¶
type StreamWriter ¶
type Task ¶
type Task struct { ID string `json:"id"` Blueprint config.Blueprint `json:"blueprint"` IgnoreErrors bool `json:"ignoreErrors"` Docker TaskDocker `json:"docker"` Steps []Step `json:"steps"` Status string `json:"status"` StartedAt *time.Time `json:"startedAt"` UpdatedAt *time.Time `json:"updatedAt"` CompletedAt *time.Time `json:"completedAt"` ProjectRoot string `json:"-"` // contains filtered or unexported fields }
func NewTask ¶
func NewTask( c *config.Blueprint, paramResolver BackupResolver, repository *git.Repository, branch string, commitSha string, projectRoot string, ) *Task
func (*Task) UnmarshalJSON ¶
func (*Task) UpdateSetup ¶
func (t *Task) UpdateSetup( backupResolver BackupResolver, repository *git.Repository, branch string, commitSha string, )
type TaskDocker ¶
type TaskDocker struct {
Registries []DockerRegistry `json:"registries"`
}
Click to show internal directories.
Click to hide internal directories.