Documentation ¶
Index ¶
- Variables
- type Group
- type InParallel
- type Job
- type Pipeline
- type Resource
- type ResourceType
- type ResourceTypes
- type Step
- type StepAggregate
- type StepDo
- type StepGet
- type StepHook
- type StepInParallel
- type StepPut
- type StepTask
- type StepTry
- type Steps
- type TaskCache
- type TaskConfig
- type TaskImageResource
- type TaskInput
- type TaskOutput
- type TaskRun
Constants ¶
This section is empty.
Variables ¶
View Source
var GeneratedPipeline string
View Source
var GroupNameToBlock = orderedmap.New()
View Source
var JobNameToBlock = orderedmap.New()
View Source
var ResourceNameToBlock = orderedmap.New()
View Source
var ResourceTypeNameToBlock = orderedmap.New()
View Source
var StepNameToBlock = orderedmap.New()
View Source
var TaskConfigNameToBlock = orderedmap.New()
View Source
var TaskImageNameToBlock = orderedmap.New()
Functions ¶
This section is empty.
Types ¶
type Group ¶
type Group struct { Name string `yaml:"name,omitempty" validate:"required"` Jobs []Job `yaml:"jobs,omitempty"` Resources []Resource `yaml:"resources,omitempty"` }
func (Group) MarshalYAML ¶
func (*Group) UnmarshalYAML ¶
type InParallel ¶
type Job ¶
type Job struct { Name string `yaml:"name,omitempty"` Plan Steps `yaml:"plan,omitempty"` Serial bool `yaml:"serial,omitempty"` SerialGroups []string `yaml:"serial_groups,omitempty"` BuildLogsToRetain int `yaml:"build_logs_to_retain,omitempty"` MaxInFlight int `yaml:"max_in_flight,omitempty"` // TODO: make default 1 Public bool `yaml:"public,omitempty"` DisableManualTrigger bool `yaml:"disable_manual_trigger,omitempty"` Interruptible bool `yaml:"interruptible,omitempty"` OnSuccess Step `yaml:"on_success,omitempty"` OnFailure Step `yaml:"on_failure,omitempty"` OnAbort Step `yaml:"on_abort,omitempty"` Ensure Step `yaml:"ensure,omitempty"` }
func (*Job) UnmarshalYAML ¶
type Pipeline ¶
type Pipeline struct { Name string `yaml:"name,omitempty"` ResourceTypes ResourceTypes `yaml:"resource_types,omitempty"` Resources []Resource `yaml:"resources,omitempty"` Jobs []Job `yaml:"jobs,omitempty"` Groups []Group `yaml:"groups,omitempty"` }
func (*Pipeline) UnmarshalYAML ¶
type Resource ¶
type Resource struct { Name string `yaml:"name,omitempty"` Type string `yaml:"type,omitempty"` Source map[string]interface{} `yaml:"source,omitempty"` Version interface{} `yaml:"version,omitempty"` // TODO: validate ("latest" | "every" | {version}) CheckEvery string `yaml:"check_every,omitempty"` // TODO: check is valid duration Tags []string `yaml:"tags,omitempty"` WebhookToken string `yaml:"webhook_token,omitempty"` }
type ResourceType ¶
type ResourceType struct { Name string `yaml:"name,omitempty" validate:"required"` // TODO: add validation later Type string `yaml:"type,omitempty" validate:"required"` Source map[string]interface{} `yaml:"source,omitempty"` Privileged bool `yaml:"privileged,omitempty"` Params map[string]interface{} `yaml:"params,omitempty"` CheckEvery string `yaml:"check_every,omitempty"` Tags []string `yaml:"tags,omitempty"` }
func (ResourceType) Generate ¶
func (r ResourceType) Generate() string
type ResourceTypes ¶
type ResourceTypes []ResourceType
type StepAggregate ¶
type StepAggregate struct { Aggregate Steps `yaml:"aggregate,omitempty"` StepHook `yaml:",inline,omitempty"` }
func (StepAggregate) Generate ¶
func (s StepAggregate) Generate() string
func (StepAggregate) StepType ¶
func (s StepAggregate) StepType() string
func (*StepAggregate) UnmarshalYAML ¶
func (s *StepAggregate) UnmarshalYAML(unmarshal func(interface{}) error) error
type StepDo ¶
func (*StepDo) UnmarshalYAML ¶
type StepGet ¶
type StepGet struct { Get string `yaml:"get,omitempty"` Resource string `yaml:"resource,omitempty"` Version interface{} `yaml:"version,omitempty"` Passed []string `yaml:"passed,omitempty"` //TODO: change to []Job? Params map[string]interface{} `yaml:"params,omitempty"` Trigger bool `yaml:"trigger,omitempty"` StepHook `yaml:",inline,omitempty"` }
func (*StepGet) UnmarshalYAML ¶
type StepHook ¶
type StepHook struct { OnSuccess Step `yaml:"on_success,omitempty"` OnFailure Step `yaml:"on_failure,omitempty"` OnAbort Step `yaml:"on_abort,omitempty"` Ensure Step `yaml:"ensure,omitempty"` Tags []string `yaml:"tags,omitempty"` Timeout string `yaml:"timeout,omitempty"` // TODO: validate time duration Attempts int `yaml:"attempts,omitempty"` }
TODO: add validation for all step structs
func (*StepHook) UnmarshalYAML ¶
Due to the implementation of yaml:",inline", the inlined struct's field is processed as if they are the fields of the outer struct. Which means the custom unmarshal rule of the inlined StepHook struct will not be applied automatically. Thus when unmarshaling steps, the following unmarshal rule needs to be applied manually in each step's custom unmarshal rule.
type StepInParallel ¶
type StepInParallel struct { InParallel InParallel `yaml:"in_parallel,omitempty"` StepHook `yaml:",inline,omitempty"` }
func (StepInParallel) Generate ¶
func (s StepInParallel) Generate() string
func (StepInParallel) StepType ¶
func (s StepInParallel) StepType() string
func (*StepInParallel) UnmarshalYAML ¶
func (s *StepInParallel) UnmarshalYAML(unmarshal func(interface{}) error) error
type StepPut ¶
type StepPut struct { Put string `yaml:"put,omitempty"` Resource string `yaml:"resource,omitempty"` Params map[string]interface{} `yaml:"params,omitempty"` GetParams map[string]interface{} `yaml:"get_params,omitempty"` StepHook `yaml:",inline,omitempty"` }
func (*StepPut) UnmarshalYAML ¶
type StepTask ¶
type StepTask struct { Task string `yaml:"task,omitempty"` Config *TaskConfig `yaml:"config,omitempty"` // TODO: validate config and file can have only one set File string `yaml:"file,omitempty"` Privileged bool `yaml:"privileged,omitempty"` Params map[string]interface{} `yaml:"params,omitempty"` Image string `yaml:"image,omitempty"` InputMapping map[string]interface{} `yaml:"input_mapping,omitempty"` OutputMapping map[string]interface{} `yaml:"output_mapping,omitempty"` StepHook `yaml:",inline,omitempty"` }
func (*StepTask) UnmarshalYAML ¶
type StepTry ¶
func (*StepTry) UnmarshalYAML ¶
type TaskConfig ¶
type TaskConfig struct { Platform string `yaml:"platform,omitempty"` ImageResource *TaskImageResource `yaml:"image_resource,omitempty"` RootfsUri string `yaml:"rootfs_uri,omitempty"` Inputs []TaskInput `yaml:"inputs,omitempty"` Outputs []TaskOutput `yaml:"outputs,omitempty"` Caches []TaskCache `yaml:"caches,omitempty"` Run *TaskRun `yaml:"run,omitempty"` Params map[string]interface{} `yaml:"params,omitempty"` }
func (TaskConfig) Generate ¶
func (t TaskConfig) Generate() string
type TaskImageResource ¶
type TaskImageResource struct { Type string `yaml:"type,omitempty"` Source map[string]interface{} `yaml:"source,omitempty"` Params map[string]interface{} `yaml:"params,omitempty"` Version map[string]interface{} `yaml:"version,omitempty"` }
func (TaskImageResource) Generate ¶
func (t TaskImageResource) Generate() string
type TaskOutput ¶
Click to show internal directories.
Click to hide internal directories.