buildkite

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

package buildkite provides the defined yaml types for Vela.

Usage:

import "github.com/go-vela/server/compiler/types/yaml/yaml"

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Build

type Build struct {
	Version     string             `` /* 224-byte string literal not displayed */
	Metadata    Metadata           `` /* 174-byte string literal not displayed */
	Environment raw.StringSliceMap `` /* 245-byte string literal not displayed */
	Worker      Worker             `` /* 196-byte string literal not displayed */
	Secrets     SecretSlice        `` /* 180-byte string literal not displayed */
	Services    ServiceSlice       `` /* 202-byte string literal not displayed */
	Stages      StageSlice         `` /* 211-byte string literal not displayed */
	Steps       StepSlice          `` /* 211-byte string literal not displayed */
	Templates   TemplateSlice      `` /* 192-byte string literal not displayed */
	Deployment  Deployment         `` /* 187-byte string literal not displayed */
	Git         Git                `` /* 184-byte string literal not displayed */
}

Build is the yaml representation of a build for a pipeline.

func (*Build) ToPipelineAPI

func (b *Build) ToPipelineAPI() *api.Pipeline

ToPipelineAPI converts the Build type to an API Pipeline type.

func (*Build) ToYAML

func (b *Build) ToYAML() *yaml.Build

func (*Build) UnmarshalYAML

func (b *Build) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements the Unmarshaler interface for the Build type.

type CancelOptions

type CancelOptions struct {
	Running       *bool `` /* 255-byte string literal not displayed */
	Pending       *bool `` /* 254-byte string literal not displayed */
	DefaultBranch *bool `` /* 283-byte string literal not displayed */
}

CancelOptions is the yaml representation of the auto_cancel block for a pipeline.

func (*CancelOptions) ToYAML

func (ac *CancelOptions) ToYAML() *yaml.CancelOptions

type Deployment

type Deployment struct {
	Targets    raw.StringSlice `` /* 220-byte string literal not displayed */
	Parameters ParameterMap    `` /* 215-byte string literal not displayed */
	Template   StepTemplate    `` /* 220-byte string literal not displayed */
}

Deployment is the yaml representation of a deployment block in a pipeline.

func (*Deployment) ToPipeline

func (d *Deployment) ToPipeline() *pipeline.Deployment

ToPipeline converts the Deployment type to a pipeline Deployment type.

func (*Deployment) ToYAML

func (d *Deployment) ToYAML() *yaml.Deployment

type Git

type Git struct {
	Token `` /* 205-byte string literal not displayed */
}

Git is the yaml representation of git configurations for a pipeline.

func (*Git) ToPipeline

func (g *Git) ToPipeline() *pipeline.Git

ToPipeline converts the Git type to a pipeline Git type.

func (*Git) ToYAML

func (g *Git) ToYAML() *yaml.Git

type Metadata

type Metadata struct {
	Template     bool           `` /* 217-byte string literal not displayed */
	RenderInline bool           `` /* 229-byte string literal not displayed */
	Clone        *bool          `` /* 226-byte string literal not displayed */
	Environment  []string       `` /* 240-byte string literal not displayed */
	AutoCancel   *CancelOptions `` /* 263-byte string literal not displayed */
}

Metadata is the yaml representation of the metadata block for a pipeline.

func (*Metadata) HasEnvironment

func (m *Metadata) HasEnvironment(container string) bool

HasEnvironment checks if the container type is contained within the environment list.

func (*Metadata) ToPipeline

func (m *Metadata) ToPipeline() *pipeline.Metadata

ToPipeline converts the Metadata type to a pipeline Metadata type.

func (*Metadata) ToYAML

func (m *Metadata) ToYAML() *yaml.Metadata

type Origin

type Origin struct {
	Environment raw.StringSliceMap     `` /* 219-byte string literal not displayed */
	Image       string                 `` /* 237-byte string literal not displayed */
	Name        string                 `` /* 216-byte string literal not displayed */
	Parameters  map[string]interface{} `` /* 219-byte string literal not displayed */
	Secrets     StepSecretSlice        `` /* 225-byte string literal not displayed */
	Pull        string                 `` /* 299-byte string literal not displayed */
	Ruleset     Ruleset                `` /* 215-byte string literal not displayed */
}

Origin is the yaml representation of a method for looking up secrets with a secret plugin.

func (*Origin) Empty

func (o *Origin) Empty() bool

Empty returns true if the provided origin is empty.

func (*Origin) MergeEnv

func (o *Origin) MergeEnv(environment map[string]string) error

MergeEnv takes a list of environment variables and attempts to set them in the secret environment. If the environment variable already exists in the secret, than this will overwrite the existing environment variable.

func (*Origin) ToPipeline

func (o *Origin) ToPipeline() *pipeline.Container

ToPipeline converts the Origin type to a pipeline Container type.

func (*Origin) ToYAML

func (o *Origin) ToYAML() yaml.Origin

type Parameter

type Parameter struct {
	Description string          `` /* 202-byte string literal not displayed */
	Type        string          `` /* 195-byte string literal not displayed */
	Required    bool            `` /* 218-byte string literal not displayed */
	Options     raw.StringSlice `` /* 207-byte string literal not displayed */
	Min         int             `` /* 205-byte string literal not displayed */
	Max         int             `` /* 205-byte string literal not displayed */
}

Parameters is the yaml representation of the deploy parameters from a deployment block in a pipeline.

func (*Parameter) ToYAML

func (p *Parameter) ToYAML() *yaml.Parameter

type ParameterMap

type ParameterMap map[string]*Parameter

ParameterMap is the yaml representation of the parameters block for a deployment block of a pipeline.

func (*ParameterMap) ToPipeline

func (p *ParameterMap) ToPipeline() pipeline.ParameterMap

ToPipeline converts the Parameters type to a pipeline Parameters type.

func (*ParameterMap) ToYAML

func (p *ParameterMap) ToYAML() yaml.ParameterMap

type Rules

type Rules struct {
	Branch   []string `` /* 221-byte string literal not displayed */
	Comment  []string `` /* 229-byte string literal not displayed */
	Event    []string `` /* 219-byte string literal not displayed */
	Path     []string `` /* 236-byte string literal not displayed */
	Repo     []string `` /* 212-byte string literal not displayed */
	Sender   []string `` /* 220-byte string literal not displayed */
	Status   []string `` /* 251-byte string literal not displayed */
	Tag      []string `` /* 227-byte string literal not displayed */
	Target   []string `` /* 231-byte string literal not displayed */
	Label    []string `` /* 218-byte string literal not displayed */
	Instance []string `` /* 215-byte string literal not displayed */
}

Rules is the yaml representation of the ruletypes from a ruleset block for a step in a pipeline.

func (*Rules) ToPipeline

func (r *Rules) ToPipeline() *pipeline.Rules

ToPipeline converts the Rules type to a pipeline Rules type.

func (*Rules) ToYAML

func (r *Rules) ToYAML() *yaml.Rules

func (*Rules) UnmarshalYAML

func (r *Rules) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements the Unmarshaler interface for the Rules type.

type Ruleset

type Ruleset struct {
	If       Rules  `` /* 198-byte string literal not displayed */
	Unless   Rules  `` /* 205-byte string literal not displayed */
	Matcher  string `` /* 176-byte string literal not displayed */
	Operator string `` /* 251-byte string literal not displayed */
	Continue bool   `` /* 232-byte string literal not displayed */
}

Ruleset is the yaml representation of a ruleset block for a step in a pipeline.

func (*Ruleset) ToPipeline

func (r *Ruleset) ToPipeline() *pipeline.Ruleset

ToPipeline converts the Ruleset type to a pipeline Ruleset type.

func (*Ruleset) ToYAML

func (r *Ruleset) ToYAML() *yaml.Ruleset

func (*Ruleset) UnmarshalYAML

func (r *Ruleset) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements the Unmarshaler interface for the Ruleset type.

type Secret

type Secret struct {
	Name   string `` /* 218-byte string literal not displayed */
	Key    string `` /* 209-byte string literal not displayed */
	Engine string `` /* 238-byte string literal not displayed */
	Type   string `` /* 242-byte string literal not displayed */
	Origin Origin `` /* 218-byte string literal not displayed */
	Pull   string `` /* 251-byte string literal not displayed */
}

Secret is the yaml representation of a secret from the secrets block for a pipeline.

func (*Secret) ToYAML

func (s *Secret) ToYAML() *yaml.Secret

type SecretSlice

type SecretSlice []*Secret

SecretSlice is the yaml representation of the secrets block for a pipeline.

func (*SecretSlice) ToPipeline

func (s *SecretSlice) ToPipeline() *pipeline.SecretSlice

ToPipeline converts the SecretSlice type to a pipeline SecretSlice type.

func (*SecretSlice) ToYAML

func (s *SecretSlice) ToYAML() *yaml.SecretSlice

func (*SecretSlice) UnmarshalYAML

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

UnmarshalYAML implements the Unmarshaler interface for the SecretSlice type.

type Service

type Service struct {
	Image       string             `` /* 234-byte string literal not displayed */
	Name        string             `` /* 237-byte string literal not displayed */
	Entrypoint  raw.StringSlice    `` /* 211-byte string literal not displayed */
	Environment raw.StringSliceMap `` /* 222-byte string literal not displayed */
	Ports       raw.StringSlice    `` /* 220-byte string literal not displayed */
	Pull        string             `` /* 301-byte string literal not displayed */
	Ulimits     UlimitSlice        `` /* 205-byte string literal not displayed */
	User        string             `` /* 192-byte string literal not displayed */
}

Service is the yaml representation of a Service in a pipeline.

func (*Service) MergeEnv

func (s *Service) MergeEnv(environment map[string]string) error

MergeEnv takes a list of environment variables and attempts to set them in the service environment. If the environment variable already exists in the service, than this will overwrite the existing environment variable.

func (*Service) ToYAML

func (s *Service) ToYAML() *yaml.Service

type ServiceSlice

type ServiceSlice []*Service

ServiceSlice is the yaml representation of the Services block for a pipeline.

func (*ServiceSlice) ToPipeline

func (s *ServiceSlice) ToPipeline() *pipeline.ContainerSlice

ToPipeline converts the ServiceSlice type to a pipeline ContainerSlice type.

func (*ServiceSlice) ToYAML

func (s *ServiceSlice) ToYAML() *yaml.ServiceSlice

func (*ServiceSlice) UnmarshalYAML

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

UnmarshalYAML implements the Unmarshaler interface for the ServiceSlice type.

type Stage

type Stage struct {
	Environment raw.StringSliceMap `` /* 239-byte string literal not displayed */
	Name        string             `` /* 222-byte string literal not displayed */
	Needs       raw.StringSlice    `` /* 221-byte string literal not displayed */
	Independent bool               `` /* 133-byte string literal not displayed */
	Steps       StepSlice          `` /* 220-byte string literal not displayed */
}

Stage is the yaml representation of a stage in a pipeline.

func (*Stage) MergeEnv

func (s *Stage) MergeEnv(environment map[string]string) error

MergeEnv takes a list of environment variables and attempts to set them in the stage environment. If the environment variable already exists in the stage, than this will overwrite the existing environment variable.

func (*Stage) ToYAML

func (s *Stage) ToYAML() *yaml.Stage

type StageSlice

type StageSlice []*Stage

StageSlice is the yaml representation of the stages block for a pipeline.

func (StageSlice) JSONSchemaExtend

func (StageSlice) JSONSchemaExtend(schema *jsonschema.Schema)

JSONSchemaExtend handles some overrides that need to be in place for this type for the jsonschema generation.

Stages are not really a slice of stages to the user. This change supports the map they really are.

func (StageSlice) MarshalYAML

func (s StageSlice) MarshalYAML() (interface{}, error)

MarshalYAML implements the marshaler interface for the StageSlice type.

func (*StageSlice) ToPipeline

func (s *StageSlice) ToPipeline() *pipeline.StageSlice

ToPipeline converts the StageSlice type to a pipeline StageSlice type.

func (*StageSlice) ToYAML

func (s *StageSlice) ToYAML() *yaml.StageSlice

func (*StageSlice) UnmarshalYAML

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

UnmarshalYAML implements the Unmarshaler interface for the StageSlice type.

type Step

type Step struct {
	Ruleset     Ruleset                `` /* 215-byte string literal not displayed */
	Commands    raw.StringSlice        `` /* 216-byte string literal not displayed */
	Entrypoint  raw.StringSlice        `` /* 207-byte string literal not displayed */
	Secrets     StepSecretSlice        `` /* 224-byte string literal not displayed */
	Template    StepTemplate           `` /* 232-byte string literal not displayed */
	Ulimits     UlimitSlice            `` /* 202-byte string literal not displayed */
	Volumes     VolumeSlice            `` /* 195-byte string literal not displayed */
	Image       string                 `` /* 249-byte string literal not displayed */
	Name        string                 `` /* 207-byte string literal not displayed */
	Pull        string                 `` /* 299-byte string literal not displayed */
	Environment raw.StringSliceMap     `` /* 238-byte string literal not displayed */
	Parameters  map[string]interface{} `` /* 210-byte string literal not displayed */
	Detach      bool                   `` /* 212-byte string literal not displayed */
	Privileged  bool                   `` /* 207-byte string literal not displayed */
	User        string                 `` /* 192-byte string literal not displayed */
	ReportAs    string                 `` /* 204-byte string literal not displayed */
	IDRequest   string                 `` /* 205-byte string literal not displayed */
}

Step is the yaml representation of a step from the steps block for a pipeline.

func (*Step) MergeEnv

func (s *Step) MergeEnv(environment map[string]string) error

MergeEnv takes a list of environment variables and attempts to set them in the step environment. If the environment variable already exists in the step, than this will overwrite the existing environment variable.

func (*Step) ToYAML

func (s *Step) ToYAML() *yaml.Step

type StepSecret

type StepSecret struct {
	Source string `yaml:"source,omitempty"`
	Target string `yaml:"target,omitempty"`
}

StepSecret is the yaml representation of a secret from a secrets block for a step in a pipeline.

type StepSecretSlice

type StepSecretSlice []*StepSecret

StepSecretSlice is the yaml representation of the secrets block for a step in a pipeline.

func (*StepSecretSlice) ToPipeline

func (s *StepSecretSlice) ToPipeline() *pipeline.StepSecretSlice

ToPipeline converts the StepSecretSlice type to a pipeline StepSecretSlice type.

func (*StepSecretSlice) ToYAML

func (s *StepSecretSlice) ToYAML() *yaml.StepSecretSlice

func (*StepSecretSlice) UnmarshalYAML

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

UnmarshalYAML implements the Unmarshaler interface for the StepSecretSlice type.

type StepSlice

type StepSlice []*Step

StepSlice is the yaml representation of the steps block for a pipeline.

func (*StepSlice) ToPipeline

func (s *StepSlice) ToPipeline() *pipeline.ContainerSlice

ToPipeline converts the StepSlice type to a pipeline ContainerSlice type.

func (*StepSlice) ToYAML

func (s *StepSlice) ToYAML() *yaml.StepSlice

func (*StepSlice) UnmarshalYAML

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

UnmarshalYAML implements the Unmarshaler interface for the StepSlice type.

type StepTemplate

type StepTemplate struct {
	Name      string                 `` /* 207-byte string literal not displayed */
	Variables map[string]interface{} `` /* 188-byte string literal not displayed */
}

StepTemplate is the yaml representation of the template block for a step in a pipeline.

func (*StepTemplate) ToYAML

func (t *StepTemplate) ToYAML() yaml.StepTemplate

type Template

type Template struct {
	Name      string                 `` /* 211-byte string literal not displayed */
	Source    string                 `` /* 212-byte string literal not displayed */
	Format    string                 `` /* 253-byte string literal not displayed */
	Type      string                 `` /* 231-byte string literal not displayed */
	Variables map[string]interface{} `` /* 197-byte string literal not displayed */
}

Template is the yaml representation of a template from the templates block for a pipeline.

func TemplateFromAPI

func TemplateFromAPI(t *api.Template) *Template

TemplateFromAPI converts the API Template type to a yaml Template type.

func (*Template) ToAPI

func (t *Template) ToAPI() *api.Template

ToAPI converts the Template type to an API Template type.

func (*Template) ToYAML

func (t *Template) ToYAML() *yaml.Template

type TemplateSlice

type TemplateSlice []*Template

TemplateSlice is the yaml representation of the templates block for a pipeline.

func (*TemplateSlice) Map

func (t *TemplateSlice) Map() map[string]*Template

Map helper function that creates a map of templates from a slice of templates.

func (*TemplateSlice) ToYAML

func (t *TemplateSlice) ToYAML() *yaml.TemplateSlice

func (*TemplateSlice) UnmarshalYAML

func (t *TemplateSlice) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements the Unmarshaler interface for the TemplateSlice type.

type Token

type Token struct {
	Repositories []string          `` /* 201-byte string literal not displayed */
	Permissions  map[string]string `` /* 227-byte string literal not displayed */
}

Token is the yaml representation of the git token. Only applies when using GitHub App installations.

type Ulimit

type Ulimit struct {
	Name string `` /* 201-byte string literal not displayed */
	Soft int64  `` /* 169-byte string literal not displayed */
	Hard int64  `` /* 169-byte string literal not displayed */
}

Ulimit is the yaml representation of a ulimit from the ulimits block for a step in a pipeline.

func (*Ulimit) ToYAML

func (u *Ulimit) ToYAML() *yaml.Ulimit

type UlimitSlice

type UlimitSlice []*Ulimit

UlimitSlice is the yaml representation of the ulimits block for a step in a pipeline.

func (*UlimitSlice) ToPipeline

func (u *UlimitSlice) ToPipeline() *pipeline.UlimitSlice

ToPipeline converts the UlimitSlice type to a pipeline UlimitSlice type.

func (*UlimitSlice) ToYAML

func (u *UlimitSlice) ToYAML() *yaml.UlimitSlice

func (*UlimitSlice) UnmarshalYAML

func (u *UlimitSlice) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements the Unmarshaler interface for the UlimitSlice type.

type Volume

type Volume struct {
	Source      string `` /* 223-byte string literal not displayed */
	Destination string `` /* 245-byte string literal not displayed */
	AccessMode  string `` /* 217-byte string literal not displayed */
}

Volume is the yaml representation of a volume from a volumes block for a step in a pipeline.

func (*Volume) ToYAML

func (v *Volume) ToYAML() *yaml.Volume

type VolumeSlice

type VolumeSlice []*Volume

VolumeSlice is the yaml representation of the volumes block for a step in a pipeline.

func (*VolumeSlice) ToPipeline

func (v *VolumeSlice) ToPipeline() *pipeline.VolumeSlice

ToPipeline converts the VolumeSlice type to a pipeline VolumeSlice type.

func (*VolumeSlice) ToYAML

func (v *VolumeSlice) ToYAML() *yaml.VolumeSlice

func (*VolumeSlice) UnmarshalYAML

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

UnmarshalYAML implements the Unmarshaler interface for the VolumeSlice type.

type Worker

type Worker struct {
	Flavor   string `` /* 213-byte string literal not displayed */
	Platform string `` /* 226-byte string literal not displayed */
}

Worker is the yaml representation of a worker from a worker block in a pipeline.

func (*Worker) ToPipeline

func (w *Worker) ToPipeline() *pipeline.Worker

ToPipeline converts the Worker type to a pipeline Worker type.

func (*Worker) ToYAML

func (w *Worker) ToYAML() *yaml.Worker

Jump to

Keyboard shortcuts

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