types

package
v0.0.0-...-87f2aef Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2025 License: AGPL-3.0 Imports: 13 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigInterface

type ConfigInterface interface {
	Validate() error
}

type Factory

type Factory interface {
	GetGitlabClient() *gitlab.Client
	GetVersionController() *version.Controller
}

type Job

type Job struct {
	Names []string
	CiJob *job.CiJob
	Needs Needs

	CiJobYaml    *job.CiJobYaml
	PipelineId   string
	ExternalTags []string
	// contains filtered or unexported fields
}

func NewJob

func NewJob(name string, image string, fn func(ciJob *job.CiJob)) *Job

func (*Job) AddJobAsNeed

func (j *Job) AddJobAsNeed(job *Job) *Job

func (*Job) AddName

func (j *Job) AddName(name string) *Job

func (*Job) AddNeedByStage

func (j *Job) AddNeedByStage(job *Job, stage stages.Stage) *Job

func (*Job) AddSeveralNeeds

func (j *Job) AddSeveralNeeds(needs *Needs) *Job

func (*Job) DynamicMerge

func (j *Job) DynamicMerge(jobs *Jobs) (*Job, error)

func (*Job) EvaluateName

func (j *Job) EvaluateName(jobs *Jobs) (*Job, error)

func (*Job) GetName

func (j *Job) GetName() string

func (*Job) RemoveNeed

func (j *Job) RemoveNeed(need *Need) bool

func (*Job) Render

func (j *Job) Render() error

func (*Job) RenderNeeds

func (j *Job) RenderNeeds() (*Job, error)

func (*Job) UniqueName

func (j *Job) UniqueName() error

type Jobs

type Jobs []*Job

func GetPipelineJobs

func GetPipelineJobs(factory Factory, config PipelineConfigInterface, pipelineType PipelineType, pipelineId string) (*Jobs, error)

func LoadJobsFromPipelineConfig

func LoadJobsFromPipelineConfig(factory Factory, pipelineConfig *PipelineConfig, configTypes *PipelineTypes) (*Jobs, error)

func (*Jobs) AddJob

func (j *Jobs) AddJob(job *Job) *Jobs

func (*Jobs) DynamicMerge

func (j *Jobs) DynamicMerge() (*Jobs, error)

func (*Jobs) EvaluateNames

func (j *Jobs) EvaluateNames() (*Jobs, error)

func (*Jobs) FindJobsByPipelineId

func (j *Jobs) FindJobsByPipelineId(pipelineId string) (*Jobs, error)

func (*Jobs) GetJobs

func (j *Jobs) GetJobs() []*Job

func (*Jobs) OverwriteTags

func (j *Jobs) OverwriteTags(tags []string)

func (*Jobs) SanityCheck

func (j *Jobs) SanityCheck() error

func (*Jobs) SetJobsAsNeed

func (j *Jobs) SetJobsAsNeed(jobs *Jobs) *Jobs

type Need

type Need struct {
	Optional bool
	Job      *Job
}

func NewNeed

func NewNeed(job *Job) *Need

func (*Need) HasJob

func (n *Need) HasJob(job *Job) bool

func (*Need) NotOptional

func (n *Need) NotOptional() *Need

func (*Need) Render

func (n *Need) Render() *job.NeedYaml

type Needs

type Needs []*Need

func (*Needs) AddNeed

func (n *Needs) AddNeed(need *Need) *Needs

func (*Needs) GetNeed

func (n *Needs) GetNeed(job *Job) *Need

func (*Needs) GetNeeds

func (n *Needs) GetNeeds() []*Need

func (*Needs) HasJob

func (n *Needs) HasJob(job *Job) bool

func (*Needs) HasNeed

func (n *Needs) HasNeed(need *Need) bool

func (*Needs) NeedsYaml

func (n *Needs) NeedsYaml() *job.NeedsYaml

func (*Needs) RemoveJob

func (n *Needs) RemoveJob(job *Job) bool

func (*Needs) RemoveNeed

func (n *Needs) RemoveNeed(need *Need) bool

func (*Needs) ReplaceJob

func (n *Needs) ReplaceJob(old *Job, new *Need) *Needs

type PipelineBuilderInterface

type PipelineBuilderInterface interface {
	Build(pipelineTypeConfig PipelineTypeConfig) (*Jobs, error)
}

type PipelineBuilderWrapper

type PipelineBuilderWrapper struct {
	Builder            PipelineBuilderInterface
	PipelineTypeConfig PipelineTypeConfig
}

func (*PipelineBuilderWrapper) Build

func (p *PipelineBuilderWrapper) Build() (*Jobs, error)

type PipelineConfig

type PipelineConfig struct {
	Noop             bool                 `yaml:"noop,omitempty"`
	Versioning       bool                 `yaml:"versioning,omitempty"`
	Tags             []string             `yaml:"tags"`
	DependencyProxy  string               `yaml:"dependencyProxy"`
	Pipelines        []PipelineTypeConfig `yaml:"pipelines"`
	PrivateTokenName string               `yaml:"privateTokenName"`
}

func (*PipelineConfig) Decode

func (p *PipelineConfig) Decode(factory Factory, configTypes PipelineConfigTypeMap) (*Jobs, error)

type PipelineConfigInterface

type PipelineConfigInterface interface {
	New() PipelineConfigInterface
	ConfigInterface
	Build(factory Factory, pipelineType PipelineType, Id string) (*Jobs, error)
	Rules() *job.Rules
}

type PipelineConfigTypeMap

type PipelineConfigTypeMap map[PipelineType]PipelineConfigInterface

type PipelineType

type PipelineType string

func (PipelineType) String

func (p PipelineType) String() string

type PipelineTypeConfig

type PipelineTypeConfig struct {
	Type       PipelineType `yaml:"type"`
	Config     interface{}  `yaml:"config"`
	PipelineId string       `yaml:"id"`
	Needs      []string     `yaml:"needs"`
	Tags       []string     `yaml:"tags"`
}

func (*PipelineTypeConfig) Decode

func (p *PipelineTypeConfig) Decode(factory Factory, configTypes PipelineConfigTypeMap) (*Jobs, error)

func (*PipelineTypeConfig) GetType

func (p *PipelineTypeConfig) GetType() PipelineType

type PipelineTypeConfigInterface

type PipelineTypeConfigInterface interface {
	Decode(configTypes *PipelineConfigTypeMap) error
	GetType() PipelineType
}

type PipelineTypes

type PipelineTypes struct {
	// contains filtered or unexported fields
}

func NewPipelineTypes

func NewPipelineTypes() *PipelineTypes

func (*PipelineTypes) Add

func (p *PipelineTypes) Add(pipelineType PipelineType, config PipelineConfigInterface) *PipelineTypes

func (*PipelineTypes) GetTypesMap

func (p *PipelineTypes) GetTypesMap() PipelineConfigTypeMap

func (*PipelineTypes) Remove

func (p *PipelineTypes) Remove(pipelineType PipelineType) *PipelineTypes

Jump to

Keyboard shortcuts

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