Documentation
¶
Index ¶
- Constants
- func ExecuteJob(ctx context.Context, cfg ExecuteJobConfig) error
- type Dependency
- type ExecuteJobConfig
- type Executor
- type ExecutorConfig
- type GitHub
- type Job
- type JobResult
- type Pipeline
- type PipelineRuntime
- type PushConfig
- type ReleaseArtifact
- type ReleaseConfig
- type Scheduler
- type Step
- type ValidationError
- type ValidationErrors
- type WorkItem
Constants ¶
const DEFAULTPARALLEL = 12
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Dependency ¶
type ExecuteJobConfig ¶
type ExecuteJobConfig struct {
// contains filtered or unexported fields
}
type Executor ¶
type Executor struct {
MaxParallel int
Runner runner.Runner
Checkouter checkout.Checkouter
ArtifactStore artifact.Store
LogsStore logs.Store
// contains filtered or unexported fields
}
func NewExecutor ¶
func NewExecutor(cfg ExecutorConfig) *Executor
type ExecutorConfig ¶
type GitHub ¶
type GitHub struct {
Push *PushConfig `json:"push,omitempty"`
Release *ReleaseConfig `json:"release,omitempty"`
}
type Pipeline ¶
type Pipeline struct {
Name string `json:"name"`
Description string `json:"description"`
Visibility string `json:"visibility,omitempty"`
Checkout checkout.Checkout `json:"checkout"`
Jobs []Job `json:"jobs"`
GitHub *GitHub `json:"github,omitempty"`
}
func ProcessJSON ¶
func ProcessJSONFile ¶
func (*Pipeline) LookupArtifact ¶
type PipelineRuntime ¶
type PipelineRuntime struct {
// contains filtered or unexported fields
}
PipelineRuntime is a state machine that asynchronously tracks the status of a job in a pipeline while it is running. It is safe to wait on by multiple goroutines
PipelineRuntime is not meant to be mutated, use getters.
func (*PipelineRuntime) Done ¶
func (pe *PipelineRuntime) Done() <-chan struct{}
func (*PipelineRuntime) ID ¶
func (pe *PipelineRuntime) ID() string
ID returns the ID associaated with the PipelineRuntime
func (*PipelineRuntime) Pipeline ¶
func (pe *PipelineRuntime) Pipeline() *Pipeline
Pipeline returns the Pipeline associated with the PipelineRuntime
func (*PipelineRuntime) Stop ¶
func (pe *PipelineRuntime) Stop()
func (*PipelineRuntime) Wait ¶
func (pe *PipelineRuntime) Wait() error
type PushConfig ¶
type ReleaseArtifact ¶
type ReleaseConfig ¶
type ReleaseConfig struct {
On string `json:"on"`
Artifacts []ReleaseArtifact `json:"artifacts"`
}
type Scheduler ¶
type Scheduler struct {
// contains filtered or unexported fields
}
Scheduler is responsible for bookeeping of Jobs in a pipeline. It stores standard bookeeping data for Topological sort using Kahn's algorithm
Note: Not safe for concurrent use. It must be driven from single goroutine
Internally: we use Kahn's Algorithm to schedule jobs in a pipeline based on dependencies. We execute all parent jobs (on which other jobs depend on) and then execute the next set of dependent processes and so on until all of them execute completely or return an error.
func NewScheduler ¶
NewScheduler Creates a new instance of a Scheduler and populates it with the jobs and their dependencies from a **validated** pipeline p.
func (*Scheduler) Complete ¶
Complete marks a jobName as complete and returns the next set of child Jobs that can be processed immediately
type ValidationError ¶
func (ValidationError) String ¶
func (v ValidationError) String() string
String generates the error string for a validation error
type ValidationErrors ¶
type ValidationErrors struct {
Errors []ValidationError
}
func (*ValidationErrors) Add ¶
func (e *ValidationErrors) Add(err ValidationError)
Add appends a ValidationError to ValidationErrors.Errors
func (ValidationErrors) Error ¶
func (e ValidationErrors) Error() string
Error generates the error string summary for all validation errors
It returns a bulleted list.