config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultConfig = Config{}

Functions

This section is empty.

Types

type BaseStep

type BaseStep struct {
	Type string `json:"type"`
	Name string `json:"name"`
	When *When  `json:"when"`
}

type CloneStep

type CloneStep struct {
	BaseStep `json:",inline"`
}

type Config

type Config struct {
	Runs []*Run `json:"runs"`

	DockerRegistriesAuth map[string]*DockerRegistryAuth `json:"docker_registries_auth"`
}

func ParseConfig

func ParseConfig(configData []byte, format ConfigFormat) (*Config, error)

func (*Config) Run

func (c *Config) Run(runName string) *Run

type ConfigFormat

type ConfigFormat int
const (
	// ConfigFormatJSON handles both json or yaml format (since json is a subset of yaml)
	ConfigFormatJSON ConfigFormat = iota
	ConfigFormatJsonnet
)

type Container

type Container struct {
	Image       string           `json:"image,omitempty"`
	Environment map[string]Value `json:"environment,omitempty"`
	User        string           `json:"user"`
	Privileged  bool             `json:"privileged"`
	Entrypoint  string           `json:"entrypoint"`
}

type Depend

type Depend struct {
	TaskName   string            `json:"task"`
	Conditions []DependCondition `json:"conditions"`
}

type DependCondition

type DependCondition string
const (
	DependConditionOnSuccess DependCondition = "on_success"
	DependConditionOnFailure DependCondition = "on_failure"
	DependConditionOnSkipped DependCondition = "on_skipped"
)

type Depends

type Depends []*Depend

func (*Depends) UnmarshalJSON

func (d *Depends) UnmarshalJSON(b []byte) error

type DockerRegistryAuth

type DockerRegistryAuth struct {
	Type DockerRegistryAuthType `json:"type"`

	// basic auth
	Username Value `json:"username"`
	Password Value `json:"password"`

	// encoded auth string
	Auth string `json:"auth"`
}

type DockerRegistryAuthType

type DockerRegistryAuthType string
const (
	DockerRegistryAuthTypeBasic       DockerRegistryAuthType = "basic"
	DockerRegistryAuthTypeEncodedAuth DockerRegistryAuthType = "encodedauth"
)

type RestoreCacheStep

type RestoreCacheStep struct {
	BaseStep `json:",inline"`
	Keys     []string `json:"keys"`
	DestDir  string   `json:"dest_dir"`
}

type RestoreWorkspaceStep

type RestoreWorkspaceStep struct {
	BaseStep `json:",inline"`
	DestDir  string `json:"dest_dir"`
}

type Run

type Run struct {
	Name                 string                         `json:"name"`
	Tasks                []*Task                        `json:"tasks"`
	DockerRegistriesAuth map[string]*DockerRegistryAuth `json:"docker_registries_auth"`
}

func (*Run) Task

func (r *Run) Task(taskName string) *Task

type RunStep

type RunStep struct {
	BaseStep    `json:",inline"`
	Command     string           `json:"command"`
	Environment map[string]Value `json:"environment,omitempty"`
	WorkingDir  string           `json:"working_dir"`
	Shell       string           `json:"shell"`
	User        string           `json:"user"`
}

type Runtime

type Runtime struct {
	Type       RuntimeType  `json:"type,omitempty"`
	Arch       common.Arch  `json:"arch,omitempty"`
	Containers []*Container `json:"containers,omitempty"`
}

type RuntimeType

type RuntimeType string
const (
	RuntimeTypePod RuntimeType = "pod"
)

type SaveCacheStep

type SaveCacheStep struct {
	BaseStep `json:",inline"`
	Key      string         `json:"key"`
	Contents []*SaveContent `json:"contents"`
}

type SaveContent

type SaveContent struct {
	SourceDir string   `json:"source_dir"`
	DestDir   string   `json:"dest_dir"`
	Paths     []string `json:"paths"`
}

type SaveToWorkspaceStep

type SaveToWorkspaceStep struct {
	BaseStep `json:",inline"`
	Contents []*SaveContent `json:"contents"`
}

type Step

type Step interface{}

type Steps

type Steps []Step

func (*Steps) UnmarshalJSON

func (s *Steps) UnmarshalJSON(b []byte) error

type Task

type Task struct {
	Name                 string                         `json:"name"`
	Runtime              *Runtime                       `json:"runtime"`
	Environment          map[string]Value               `json:"environment,omitempty"`
	WorkingDir           string                         `json:"working_dir"`
	Shell                string                         `json:"shell"`
	User                 string                         `json:"user"`
	Steps                Steps                          `json:"steps"`
	Depends              Depends                        `json:"depends"`
	IgnoreFailure        bool                           `json:"ignore_failure"`
	Approval             bool                           `json:"approval"`
	When                 *When                          `json:"when"`
	DockerRegistriesAuth map[string]*DockerRegistryAuth `json:"docker_registries_auth"`
}

type Value

type Value struct {
	Type  ValueType
	Value string
}

func (*Value) UnmarshalJSON

func (val *Value) UnmarshalJSON(b []byte) error

type ValueType

type ValueType int
const (
	ValueTypeString ValueType = iota
	ValueTypeFromVariable
)

type When

type When types.When

func (*When) UnmarshalJSON

func (w *When) UnmarshalJSON(b []byte) error

Jump to

Keyboard shortcuts

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