yaml

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RetryAlways                 = "always"
	RetryUnknownFailure         = "unknown_failure"
	RetryScriptFailure          = "script_failure"
	RetryApiFailure             = "api_failure"
	RetrySturckOrTimeoutFailure = "stuck_or_timeout_failure"
	RetryRunnerSystemFailure    = "runner_system_failure"
	RetryRunnerUnsupported      = "runner_unsupported"
	RetryStaleSchedule          = "stale_schedule"
	RetryJobExecutionTimeout    = "job_execution_timeout"
	RetryArchivedFailure        = "archived_failure"
	RetrySchedulerFailure       = "scheduler_failure"
	RetryIntegrityFailure       = "data_integrity_failure"
)

Enum of retry when types https://docs.gitlab.com/ee/ci/yaml/#retrywhen

Variables

This section is empty.

Functions

This section is empty.

Types

type AllowFailure

type AllowFailure struct {
	Value     bool  `yaml:"-"`
	ExitCodes []int `yaml:"exit_codes"`
}

func (*AllowFailure) MarshalYAML

func (v *AllowFailure) MarshalYAML() (interface{}, error)

MarshalYAML implements the Marshal interface.

func (*AllowFailure) UnmarshalYAML

func (v *AllowFailure) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements the unmarshal interface.

type Artifacts

type Artifacts struct {
	Paths     Stringorslice          `yaml:"paths,omitempty"`
	Exclude   Stringorslice          `yaml:"exclude,omitempty"`
	ExpireIn  string                 `yaml:"expire_in,omitempty"`
	ExposeAs  string                 `yaml:"expose_as,omitempty"`
	Name      string                 `yaml:"name,omitempty"`
	Public    *bool                  `yaml:"public,omitempty"`
	Reports   map[string]interface{} `yaml:"reports,omitempty"`
	Untracked bool                   `yaml:"untracked,omitempty"`
	When      string                 `yaml:"when,omitempty"` // on_success, on_failure, always
}
type AssetLink struct {
	Name     string `yaml:"name,omitempty"`
	Url      string `yaml:"url,omitempty"`
	FilePath string `yaml:"filepath,omitempty"`
	LinkType string `yaml:"link_type,omitempty"`
}

type Assets

type Assets struct {
	Links []*AssetLink `yaml:"links,omitempty"`
}

type Cache

type Cache struct {
	Paths        Stringorslice `yaml:"paths,omitempty"`
	Key          *CacheKey     `yaml:"key,omitempty"`
	Untracked    bool          `yaml:"untracked,omitempty"`
	Unprotect    bool          `yaml:"unprotect,omitempty"`
	When         string        `yaml:"when,omitempty"`   // on_success, on_failure, always
	Policy       string        `yaml:"policy,omitempty"` // pull, push, pull-push
	FallbackKeys Stringorslice `yaml:"fallback_keys,omitempty"`
}

type CacheKey

type CacheKey struct {
	Value  string        `yaml:"-"`
	Files  Stringorslice `yaml:"files,omitempty"`
	Prefix string        `yaml:"prefix,omitempty"`
}

func (*CacheKey) MarshalYAML

func (v *CacheKey) MarshalYAML() (interface{}, error)

func (*CacheKey) UnmarshalYAML

func (v *CacheKey) UnmarshalYAML(unmarshal func(interface{}) error) error

type Change

type Change struct {
	Paths     []string `yaml:"paths"`
	CompareTo string   `yaml:"compare_to,omitempty"`
}

func (*Change) MarshalYAML

func (v *Change) MarshalYAML() (interface{}, error)

func (*Change) UnmarshalYAML

func (v *Change) UnmarshalYAML(unmarshal func(interface{}) error) error

type Conditions

type Conditions struct {
	Refs       []string `yaml:"refs,omitempty"`
	Variables  []string `yaml:"variables,omitempty"`
	Changes    []string `yaml:"changes,omitempty"`
	Kubernetes string   `yaml:"kubernetes,omitempty"`
}

func (*Conditions) MarshalYAML

func (c *Conditions) MarshalYAML() (interface{}, error)

func (*Conditions) UnmarshalYAML

func (c *Conditions) UnmarshalYAML(unmarshal func(interface{}) error) error

type DASTConfiguration

type DASTConfiguration struct {
	SiteProfile    string `yaml:"site_profile,omitempty"`
	ScannerProfile string `yaml:"scanner_profile,omitempty"`
}

type Default

type Default struct {
	After         []string   `yaml:"after_script,omitempty"`
	Before        []string   `yaml:"before_script,omitempty"`
	Artifacts     *Artifacts `yaml:"artifacts,omitempty"`
	Cache         *Cache     `yaml:"cache,omitempty"`
	Image         *Image     `yaml:"image,omitempty"`
	Interruptible bool       `yaml:"interruptible,omitempty"`
	Retry         *Retry     `yaml:"retry,omitempty"`
	Services      []*Image   `yaml:"services,omitempty"`
	Tags          []string   `yaml:"tags,omitempty"`
	Timeout       string     `yaml:"duration,omitempty"`
}

Default defines global pipeline defaults.

type Environment

type Environment struct {
	Name           string      `yaml:"name,omitempty"`
	Url            string      `yaml:"url,omitempty"`
	OnStop         string      `yaml:"on_stop,omitempty"`
	Action         string      `yaml:"action,omitempty"` // start, prepare, stop, verify, access
	AutoStopIn     string      `yaml:"auto_stop_in,omitempty"`
	DeploymentTier string      `yaml:"deployment_tier,omitempty"` // production, staging, testing, development, other
	Kubernetes     *Kubernetes `yaml:"kubernetes,omitempty"`
}

func (*Environment) UnmarshalYAML

func (v *Environment) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements the unmarshal interface.

type Forward

type Forward struct {
	YamlVariables     *bool `yaml:"yaml_variables,omitempty"`
	PipelineVariables bool  `yaml:"pipeline_variables,omitempty"`
}

type IDToken

type IDToken struct {
	Aud interface{} `yaml:"aud"`
}

type Image

type Image struct {
	Name       string        `yaml:"name,omitempty"`
	Alias      string        `yaml:"alias,omitempty"`
	Entrypoint Stringorslice `yaml:"entrypoint,omitempty"`
	Command    Stringorslice `yaml:"command,omitempty"`
	PullPolicy Stringorslice `yaml:"pull_policy,omitempty"` // single string or array of strings
}

Image defines a container image. https://docs.gitlab.com/ee/ci/yaml/#image

func (*Image) UnmarshalYAML

func (v *Image) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements the unmarshal interface.

type Include

type Include struct {
	Local    string        `yaml:"local,omitempty"`
	Project  string        `yaml:"project,omitempty"`
	Ref      string        `yaml:"ref,omitempty"`
	Remote   string        `yaml:"remote,omitempty"`
	Template string        `yaml:"template,omitempty"`
	File     Stringorslice `yaml:"file,omitempty"`
}

Include includes external yaml files. https://docs.gitlab.com/ee/ci/yaml/#include

func (*Include) UnmarshalYAML

func (v *Include) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements the unmarshal interface.

type Inherit

type Inherit struct {
	Default   *InheritKeys `yaml:"default,omitempty"`
	Variables *InheritKeys `yaml:"variables,omitempty"`
}

func (*Inherit) MarshalYAML

func (v *Inherit) MarshalYAML() (interface{}, error)

func (*Inherit) UnmarshalYAML

func (v *Inherit) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements the unmarshal interface for Inherit.

type InheritKeys

type InheritKeys struct {
	All  bool     `yaml:"all,omitempty"`
	Keys []string `yaml:"keys,omitempty"`
}

func (*InheritKeys) UnmarshalYAML

func (v *InheritKeys) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements the unmarshal interface for InheritKeys.

type Job

type Job struct {
	After             Stringorslice            `yaml:"after_script,omitempty"`
	Artifacts         *Artifacts               `yaml:"artifacts,omitempty"`
	AllowFailure      *AllowFailure            `yaml:"allow_failure,omitempty"`
	Before            Stringorslice            `yaml:"before_script,omitempty"`
	Cache             *Cache                   `yaml:"cache,omitempty"`
	Coverage          string                   `yaml:"coverage,omitempty"`
	DASTConfiguration *DASTConfiguration       `yaml:"dast_configuration,omitempty"`
	Dependencies      Stringorslice            `yaml:"dependencies,omitempty"`
	Environment       *Environment             `yaml:"environment,omitempty"`
	Except            *Conditions              `yaml:"except,omitempty"`
	Extends           Stringorslice            `yaml:"extends,omitempty"`
	Hooks             map[string]Stringorslice `yaml:"hooks,omitempty"`
	IDTokens          map[string]*IDToken      `yaml:"id_tokens,omitempty"`
	Image             *Image                   `yaml:"image,omitempty"`
	Inherit           *Inherit                 `yaml:"inherit,omitempty"`
	Interruptible     bool                     `yaml:"interruptible,omitempty"`
	Needs             *Needs                   `yaml:"needs,omitempty"`
	Only              *Conditions              `yaml:"only,omitempty"`
	Pages             *Job                     `yaml:"pages,omitempty"`
	Parallel          *Parallel                `yaml:"parallel,omitempty"`
	Publish           string                   `yaml:"publish,omitempty"`
	Release           *Release                 `yaml:"release,omitempty"`
	ResourceGroup     string                   `yaml:"resource_group,omitempty"`
	Retry             *Retry                   `yaml:"retry,omitempty"`
	Rules             []*Rule                  `yaml:"rules,omitempty"`
	Script            Stringorslice            `yaml:"script,omitempty"`
	Secrets           map[string]*Secret       `yaml:"secrets,omitempty"`
	Services          []*Image                 `yaml:"services,omitempty"`
	Stage             string                   `yaml:"stage,omitempty"`
	Tags              Stringorslice            `yaml:"tags,omitempty"`
	Timeout           string                   `yaml:"timeout,omitempty"`
	Trigger           *Trigger                 `yaml:"trigger,omitempty"`
	Variables         map[string]*Variable     `yaml:"variables,omitempty"`
	When              string                   `yaml:"when,omitempty"` // on_success, manual, always, on_failure, delayed, never
}

Job defines a gitlab job. https://docs.gitlab.com/ee/ci/yaml/#job-keywords

func (*Job) UnmarshalYAML

func (v *Job) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements the unmarshal interface.

type Kubernetes

type Kubernetes struct {
	Namespace string `yaml:"namespace,omitempty"`
}

type Need

type Need struct {
	Job       string `yaml:"job,omitempty"`
	Ref       string `yaml:"ref,omitempty"`
	Project   string `yaml:"project,omitempty"`
	Pipeline  string `yaml:"pipeline,omitempty"`
	Artifacts bool   `yaml:"artifacts,omitempty"`
	Optional  bool   `yaml:"optional,omitempty"`
}

func (*Need) UnmarshalYAML

func (v *Need) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements the unmarshal interface.

type Needs

type Needs struct {
	Items []*Need
}

func (*Needs) MarshalYAML

func (v *Needs) MarshalYAML() (interface{}, error)

func (*Needs) UnmarshalYAML

func (v *Needs) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements the unmarshal interface.

type Parallel

type Parallel struct {
	Count  int                   `yaml:"-,omitempty"`
	Matrix []map[string][]string `yaml:"matrix,omitempty"`
}

func (*Parallel) MarshalYAML

func (v *Parallel) MarshalYAML() (interface{}, error)

func (*Parallel) UnmarshalYAML

func (v *Parallel) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements the unmarshal interface.

type Pipeline

type Pipeline struct {
	Artifacts    *Artifacts `yaml:"artifacts,omitempty"`
	Schema       string
	Default      *Default
	Include      []*Include
	Image        *Image
	Services     []*Image
	BeforeScript []string
	AfterScript  []string
	Variables    map[string]*Variable
	Cache        *Cache
	Stages       []string
	Pages        *Job
	Workflow     *Workflow
	Jobs         map[string]*Job
	TemplateJobs map[string]*Job `yaml:"-"`
}

Pipeline defines a gitlab pipeline.

func Parse

func Parse(r io.Reader) (*Pipeline, error)

Parse parses the configuration from io.Reader r.

func ParseBytes

func ParseBytes(b []byte) (*Pipeline, error)

ParseBytes parses the configuration from bytes b.

func ParseFile

func ParseFile(p string) (*Pipeline, error)

ParseFile parses the configuration from path p.

func ParseString

func ParseString(s string) (*Pipeline, error)

ParseString parses the configuration from string s.

func (*Pipeline) MarshalYAML

func (p *Pipeline) MarshalYAML() (interface{}, error)

MarshalYAML implements yaml marshalling.

func (*Pipeline) UnmarshalYAML

func (p *Pipeline) UnmarshalYAML(unmarshal func(interface{}) error) error

type Release

type Release struct {
	Tag        string        `yaml:"tag_name,omitempty"`
	TagMessage string        `yaml:"tag_message,omitempty"`
	Name       string        `yaml:"name,omitempty"`
	Desc       string        `yaml:"description,omitempty"`
	Ref        string        `yaml:"ref,omitempty"`
	Milestones Stringorslice `yaml:"milestones,omitempty"`
	ReleasedAt string        `yaml:"released_at,omitempty"`
	Assets     *Assets       `yaml:"assets,omitempty"`
}

type Retry

type Retry struct {
	Max  int           `yaml:"max,omitempty"`
	When Stringorslice `yaml:"when,omitempty"`
}

Retry defines retry logic.

func (*Retry) MarshalYAML

func (v *Retry) MarshalYAML() (interface{}, error)

func (*Retry) UnmarshalYAML

func (v *Retry) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements the unmarshal interface.

type Rule

type Rule struct {
	If            string            `yaml:"if,omitempty"`
	Changes       Change            `yaml:"changes,omitempty"`
	Exists        []string          `yaml:"exists,omitempty"`
	AllowFailures bool              `yaml:"allow_failure,omitempty"`
	Variables     map[string]string `yaml:"variables,omitempty"`
	When          string            `yaml:"when,omitempty"`
	Needs         []string          `yaml:"needs,omitempty"`
}

type Secret

type Secret struct {
	Vault *Vault `yaml:"vault,omitempty"`
	File  *bool  `yaml:"file,omitempty"`
	Token string `yaml:"token,omitempty"`
}

type Stringorslice

type Stringorslice []string

Stringorslice represents a string or an array of strings.

func (*Stringorslice) UnmarshalYAML

func (s *Stringorslice) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements the unmarshal interface.

type Trigger

type Trigger struct {
	Project  string   `yaml:"-"`
	Branch   string   `yaml:"branch,omitempty"`
	Include  string   `yaml:"include,omitempty"`
	Strategy string   `yaml:"strategy,omitempty"`
	Forward  *Forward `yaml:"forward,omitempty"`
}

func (*Trigger) MarshalYAML

func (v *Trigger) MarshalYAML() (interface{}, error)

func (*Trigger) UnmarshalYAML

func (v *Trigger) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements the yaml.Unmarshaler interface.

type Variable

type Variable struct {
	Value   string        `yaml:"value,omitempty"`
	Desc    string        `yaml:"description,omitempty"`
	Options Stringorslice `yaml:"options,omitempty"`
	Expand  *bool         `yaml:"expand,omitempty"`
}

func (*Variable) MarshalYAML

func (v *Variable) MarshalYAML() (interface{}, error)

func (*Variable) UnmarshalYAML

func (v *Variable) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements the unmarshal interface.

type Vault

type Vault struct {
	Engine *VaultEngine `yaml:"engine,omitempty"`
	Path   string       `yaml:"path,omitempty"`
	Field  string       `yaml:"field,omitempty"`
}

func (*Vault) UnmarshalYAML

func (v *Vault) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements the unmarshal interface.

type VaultEngine

type VaultEngine struct {
	Name string `yaml:"name,omitempty"`
	Path string `yaml:"path,omitempty"`
}

type Workflow

type Workflow struct {
	Name  string  `yaml:"name,omitempty"`
	Rules []*Rule `yaml:"rules,omitempty"`
}

Jump to

Keyboard shortcuts

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