yaml

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Normalize

func Normalize(config *Config)

Normalizes normalizes the pipeline configuration by grouping all top-level steps into stages.

Types

type AWS

type AWS struct {
	AccessKey string `yaml:"access-key,omitempty"`
	SecretKey string `yaml:"secret-key,omitempty"`
	OIDCRole  string `yaml:"oidc-role,omitempty"`
}

type Artifacts

type Artifacts struct {
	Download *bool
	Paths    []string
}

func (*Artifacts) MarshalYAML

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

MarshalYAML implements the marshal interface.

func (*Artifacts) UnmarshalYAML

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

UnmarshalYAML implements the unmarshal interface.

type Cache

type Cache struct {
	Key  *CacheKey
	Path string
}

Cache configures a cache path.

func (*Cache) MarshalYAML

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

MarshalYAML implements the marshal interface.

func (*Cache) UnmarshalYAML

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

UnmarshalYAML implements the unmarshal interface.

type CacheKey

type CacheKey struct {
	Files []string `json:"files"`
}

type Changesets

type Changesets struct {
	IncludePaths []string `yaml:"includePaths,omitempty"`
}

type Clone

type Clone struct {
	Depth      *Depth `yaml:"depth,omitempty"`
	Enabled    *bool  `yaml:"enabled,omitempty"`
	LFS        bool   `yaml:"lfs,omitempty"`
	SkipVerify bool   `yaml:"skip-ssl-verify,omitempty"`
}

type Condition

type Condition struct {
	Changesets *Changesets `yaml:"changesets,omitempty"`
}

type Config

type Config struct {
	Clone       *Clone       `yaml:"clone,omitempty"`
	Definitions *Definitions `yaml:"definitions,omitempty"`
	Image       *Image       `yaml:"image,omitempty"`
	Options     *Options     `yaml:"options,omitempty"`
	Pipelines   Pipelines    `yaml:"pipelines,omitempty"`
}

func Parse

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

Parse parses the configuration from io.Reader r.

func ParseBytes

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

ParseBytes parses the configuration from bytes b.

func ParseFile

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

ParseFile parses the configuration from path p.

func ParseString

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

ParseString parses the configuration from string s.

type Definitions

type Definitions struct {
	Caches   map[string]*Cache   `yaml:"caches,omitempty"`
	Services map[string]*Service `yaml:"services,omitempty"`
}

type Depth

type Depth struct {
	Full  bool
	Value int
}

Depth configures the clone depth.

func (*Depth) MarshalYAML

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

MarshalYAML implements the marshal interface.

func (*Depth) UnmarshalYAML

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

UnmarshalYAML implements the unmarshal interface.

type Image

type Image struct {
	Name      string
	Username  string
	Password  string
	Email     string
	RunAsUser int
	AWS       *AWS
}

Image configures the container image.

func (*Image) MarshalYAML

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

MarshalYAML implements the marshal interface.

func (*Image) UnmarshalYAML

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

UnmarshalYAML implements the unmarshal interface.

type Options

type Options struct {
	Docker  bool `yaml:"docker,omitempty"`
	MaxTime int  `yaml:"max-time,omitempty"`
	Size    Size `yaml:"size,omitempty"`
}

type Parallel

type Parallel struct {
	FailFast bool     `yaml:"fail-fast,omitempty"`
	Steps    []*Steps `yaml:"steps,omitempty"`
}

type Pipe

type Pipe struct {
	Name      string            `yaml:"name,omitempty"`
	Image     string            `yaml:"pipe,omitempty"`
	Variables map[string]string `yaml:"variables,omitempty"`
}

type Pipelines

type Pipelines struct {
	Default      []*Steps            `yaml:"default,omitempty"`
	Branches     map[string][]*Steps `yaml:"branches,omitempty"`
	PullRequests map[string][]*Steps `yaml:"pull-requests,omitempty"`
	Tags         map[string][]*Steps `yaml:"tags,omitempty"`
	Custom       []*Steps            `yaml:"custom,omitempty"`
}

type Script

type Script struct {
	Text string
	Pipe *Pipe
}

func (*Script) MarshalYAML

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

MarshalYAML implements the marshal interface.

func (*Script) UnmarshalYAML

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

UnmarshalYAML implements the unmarshal interface.

type Service

type Service struct {
	Image     *Image            `yaml:"image,omitempty"`
	Memory    int               `yaml:"memory,omitempty"` // default 1024
	Type      string            `yaml:"type,omitempty"`
	Variables map[string]string `yaml:"variables,omitempty"`
}

type Size

type Size int

List of machine sizes.

const (
	SizeNone Size = iota
	Size1x
	Size2x
	Size4x
	Size8x
)

Size enumeration.

func (Size) MarshalYAML

func (e Size) MarshalYAML() (interface{}, error)

MarshalJSON marshals the enum as a quoted json string

func (Size) String

func (e Size) String() string

String returns the Size as a string.

func (*Size) UnmarshalYAML

func (e *Size) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements the unmarshal interface.

type Stage

type Stage struct {
	Condition  *Condition `yaml:"condition,omitempty"`
	Deployment string     `yaml:"deployment,omitempty"` // test, staging, production
	Steps      []*Steps   `yaml:"steps,omitempty"`
	Name       string     `yaml:"name,omitempty"`
	Trigger    string     `yaml:"trigger,omitempty"`
}

type Step

type Step struct {
	Artifacts   *Artifacts    `yaml:"artifacts,omitempty"`
	Caches      []string      `yaml:"caches,omitempty"`
	Clone       *Clone        `yaml:"clone,omitempty"`
	Condition   *Condition    `yaml:"condition,omitempty"`
	Deployment  string        `yaml:"deployment,omitempty"` // test, staging, production
	FailFast    bool          `yaml:"fail-fast,omitempty"`
	Image       *Image        `yaml:"image,omitempty"`
	MaxTime     int           `yaml:"max-time,omitempty"`
	Name        string        `yaml:"name,omitempty"`
	Oidc        bool          `yaml:"oidc,omitempty"`
	RunsOn      Stringorslice `yaml:"runs-on,omitempty"`
	Script      []*Script     `yaml:"script"`
	ScriptAfter []*Script     `yaml:"after-script,omitempty"`
	Services    []string      `yaml:"services,omitempty"`
	Size        Size          `yaml:"size,omitempty"`
	Trigger     string        `yaml:"trigger,omitempty"` // automatic, manual
}

type Steps

type Steps struct {
	Step     *Step     `yaml:"step,omitempty"`
	Stage    *Stage    `yaml:"stage,omitempty"`
	Parallel *Parallel `yaml:"parallel,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 Variable

type Variable struct {
	AllowedValues []string `yaml:"allowed-values,omitempty"`
	Default       string   `yaml:"default,omitempty"`
	Name          string   `yaml:"name,omitempty"`
}

Jump to

Keyboard shortcuts

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