gitlab

package
v0.0.0-...-6c3dbee Latest Latest
Warning

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

Go to latest
Published: May 25, 2024 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	WHEN_ON_SUCCESS = "on_success"
	WHEN_ON_FAILURE = "on_failure"
	WHEN_NEVER      = "never"
	WHEN_ALWAYS     = "always"
	WHEN_MANUAL     = "manual"
	WHEN_DELAYED    = "delayed"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AllowFailure

type AllowFailure struct {
	AllowFailure          bool  `default:"false"`
	AllowFailureExitCodes []int `default:"[]"`
}

func (*AllowFailure) Parse

func (a *AllowFailure) Parse(template any) error

type Artifacts

type Artifacts struct {
	Paths    []string `default:"[]"`
	Exclude  []string `default:"[]"`
	ExpireIn string
	ExposeAs string
	Name     string
	Public   bool
	When     string
}

func (*Artifacts) Parse

func (a *Artifacts) Parse(template any) error

type AutoCancel

type AutoCancel struct {
	Commit     string `gitlabci:"on_new_commit"`
	JobFailure string `gitlabci:"on_job_failure"`
}

func (*AutoCancel) Parse

func (ac *AutoCancel) Parse(template any) error

type Cache

type Cache struct {
	Paths []string `default:"[]"`
}

func (*Cache) Parse

func (cache *Cache) Parse(template any) error

type Image

type Image struct {
	Name       string
	EntryPoint []string `default:"[]"`
}

func (*Image) Parse

func (image *Image) Parse(template any) error

type Include

type Include struct {
	File      []string
	Local     string
	Remote    string
	Project   string
	Component string
	Template  string
	Inputs    map[string]string `default:"{}"`
	Ref       string
	Rules     []Rule `default:"[]"`
	// contains filtered or unexported fields
}

func (*Include) GetTemplate

func (include *Include) GetTemplate() ([]map[any]any, error)

func (*Include) Parse

func (include *Include) Parse(template any) error

type Job

type Job struct {
	Name string

	Image Image `default:"{}"`

	Stage string `default:"test"`

	Script       []string
	BeforeScript []string `default:"[]" gitlabci:"before_script"`
	AfterScript  []string `default:"[]" gitlabci:"after_script"`

	When         string `default:"on_success"`
	Rules        []Rule
	Needs        Needs `gitlabci:"needs"`
	Dependencies []string

	Variables map[string]string

	Interruptible bool

	Extends []string

	AllowFailure AllowFailure `gitlabci:"allow_failure"`

	Artifacts Artifacts
	Cache     Cache

	Coverage string
	// contains filtered or unexported fields
}

func (*Job) Fill

func (job *Job) Fill(pipeline *Pipeline) error

func (Job) GetActiveJob

func (job Job) GetActiveJob(variables map[string]string) (Job, error)

Get a copy of the current job, but overwritten with the first active rule

func (*Job) Parse

func (job *Job) Parse(name string, template map[string]any) error

func (*Job) String

func (job *Job) String() string

type Need

type Need struct {
	Job       string
	Ref       string
	Project   string
	Pipeline  string
	Artifacts bool `default:"true"`
	Optional  bool `default:"false"`
}

func (*Need) Parse

func (need *Need) Parse(template any) error

type Needs

type Needs struct {
	// A list of needs
	Needs []Need

	// Is true when relying on stages to define dependencies
	NoNeeds bool `default:"true"`
}

func (*Needs) Parse

func (needs *Needs) Parse(template any) error

type Pipeline

type Pipeline struct {
	Stages []string `default:"[\"build\", \"test\", \"deploy\"]"`

	Include []Include `default:"[]"`

	Jobs map[string]Job `default:"{}"`

	Variables map[string]string

	WorkFlow WorkFlow

	Default Job
	// contains filtered or unexported fields
}

func Parse

func Parse(fileName string) (*Pipeline, error)

func (*Pipeline) GetActiveJobs

func (pipeline *Pipeline) GetActiveJobs(variables map[string]string) (map[string]Job, error)

func (*Pipeline) GetJobs

func (pipeline *Pipeline) GetJobs() map[string]Job

func (*Pipeline) GetJobsByStage

func (pipeline *Pipeline) GetJobsByStage(stage string) map[string]Job

func (*Pipeline) String

func (pipeline *Pipeline) String() string

type Rule

type Rule struct {
	If   string
	When string `default:"on_success"`

	Needs        Needs
	Variables    map[string]string
	AllowFailure AllowFailure `gitlabci:"allow_failure"`
	// contains filtered or unexported fields
}

func (*Rule) Parse

func (rule *Rule) Parse(template any) error

type WorkFlow

type WorkFlow struct {
	Name string
}

func (*WorkFlow) Parse

func (workflow *WorkFlow) Parse(template any) error

type WorkflowRule

type WorkflowRule struct {
	Rule
	AutoCancel AutoCancel `gitlabci:"auto_cancel"`
}

func (*WorkflowRule) Parse

func (rule *WorkflowRule) Parse(template any) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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