config

package
v0.0.0-...-3015c2b Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2019 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BuildTask

type BuildTask struct {
	TaskMeta
	Dockerfile string   `json:"dockerfile,omitempty"`
	Target     string   `json:"target,omitempty"`
	Tags       []string `json:"tags,omitempty"`
	Labels     []string `json:"labels,omitempty"`
}

func (*BuildTask) Extend

func (t *BuildTask) Extend(task Task) error

func (*BuildTask) GetType

func (t *BuildTask) GetType() string

func (*BuildTask) MarshalJSON

func (t *BuildTask) MarshalJSON() ([]byte, error)

type Config

type Config struct {
	Extends          []string            `json:"extends,omitempty"`
	Options          *Options            `json:"options,omitempty"`
	Registries       []Registry          `json:"registries,omitempty"`
	Workspace        string              `json:"workspace,omitempty"`
	Environment      []string            `json:"environment,omitempty"`
	EnvironmentFiles []string            `json:"env-file,omitempty"`
	Import           *ImportFileList     `json:"import,omitempty"`
	Export           *ExportFileList     `json:"export,omitempty"`
	Tasks            map[string]Task     `json:"tasks,omitempty"`
	Plans            map[string]*Plan    `json:"plans,omitempty"`
	Metaplans        map[string][]string `json:"metaplans,omitempty"`
}

func (*Config) ApplyOverride

func (c *Config) ApplyOverride(override *Override)

func (*Config) IsPlanDefined

func (c *Config) IsPlanDefined(name string) bool

func (*Config) Merge

func (c *Config) Merge(child *Config) error

func (*Config) Resolve

func (c *Config) Resolve() error

func (*Config) Validate

func (c *Config) Validate() error

type ECRRegistry

type ECRRegistry struct {
	AccessKeyID     string `json:"access-key-id,omitempty"`
	SecretAccessKey string `json:"secret-access-key,omitempty"`
	AccountID       string `json:"account-id,omitempty"`
	Region          string `json:"region,omitempty"`
	Role            string `json:"role,omitempty"`
}

func (*ECRRegistry) GetType

func (r *ECRRegistry) GetType() string

type ExportFileList

type ExportFileList struct {
	Files         []string `json:"files,omitempty"`
	Excludes      []string `json:"excludes,omitempty"`
	CleanExcludes []string `json:"clean-excludes,omitempty"`
}

func (*ExportFileList) Merge

func (f *ExportFileList) Merge(child *ExportFileList)

type GCRRegistry

type GCRRegistry struct {
	Hostname string `json:"hostname,omitempty"`
	Key      string `json:"key,omitempty"`
	KeyFile  string `json:"key-file,omitempty"`
}

func (*GCRRegistry) GetType

func (r *GCRRegistry) GetType() string

type Healthcheck

type Healthcheck struct {
	Command     string
	Interval    time.Duration
	Retries     int
	StartPeriod time.Duration
	Timeout     time.Duration
}

func (*Healthcheck) Extend

func (h *Healthcheck) Extend(parent *Healthcheck) error

func (*Healthcheck) MarshalJSON

func (h *Healthcheck) MarshalJSON() ([]byte, error)

type ImportFileList

type ImportFileList struct {
	Files    []string `json:"files,omitempty"`
	Excludes []string `json:"excludes,omitempty"`
}

func (*ImportFileList) Merge

func (f *ImportFileList) Merge(child *ImportFileList)

type Options

type Options struct {
	SSHIdentities       []string
	ForceSequential     bool
	HealthcheckInterval time.Duration
	PathSubstitutions   map[string]string
}

func (*Options) MarshalJSON

func (o *Options) MarshalJSON() ([]byte, error)

func (*Options) Merge

func (o *Options) Merge(child *Options)

type Override

type Override struct {
	Options          *Options
	Registries       []Registry
	Environment      []string
	EnvironmentFiles []string
	ImportExcludes   []string
	ExportExcludes   []string
	CleanExcludes    []string
}

type Plan

type Plan struct {
	Name        string   `json:"-"`
	Disabled    string   `json:"disabled,omitempty"`
	Extends     string   `json:"extends,omitempty"`
	Stages      []*Stage `json:"stages,omitempty"`
	Environment []string `json:"environment,omitempty"`
}

func (*Plan) AddStage

func (p *Plan) AddStage(stage *Stage) error

func (*Plan) Clone

func (p *Plan) Clone() *Plan

func (*Plan) InsertStage

func (p *Plan) InsertStage(stage *Stage, index int)

func (*Plan) Merge

func (p *Plan) Merge(child *Plan) error

func (*Plan) StageIndex

func (p *Plan) StageIndex(name string) int

type PlanTask

type PlanTask struct {
	TaskMeta
	Name string `json:"name,omitempty"`
}

func (*PlanTask) Extend

func (t *PlanTask) Extend(task Task) error

func (*PlanTask) GetType

func (t *PlanTask) GetType() string

func (*PlanTask) MarshalJSON

func (t *PlanTask) MarshalJSON() ([]byte, error)

type PushTask

type PushTask struct {
	TaskMeta
	Images       []string `json:"images,omitempty"`
	IncludeBuilt bool     `json:"include-built,omitempty"`
}

func (*PushTask) Extend

func (t *PushTask) Extend(task Task) error

func (*PushTask) GetType

func (t *PushTask) GetType() string

func (*PushTask) MarshalJSON

func (t *PushTask) MarshalJSON() ([]byte, error)

type Registry

type Registry interface {
	GetType() string
}

type RemoveTask

type RemoveTask struct {
	TaskMeta
	Images       []string `json:"images,omitempty"`
	IncludeBuilt bool     `json:"include-built,omitempty"`
}

func (*RemoveTask) Extend

func (t *RemoveTask) Extend(task Task) error

func (*RemoveTask) GetType

func (t *RemoveTask) GetType() string

func (*RemoveTask) MarshalJSON

func (t *RemoveTask) MarshalJSON() ([]byte, error)

type RunMode

type RunMode int
const (
	RunModeOnSuccess RunMode
	RunModeOnFailure
	RunModeAlways
)

func (RunMode) MarshalJSON

func (m RunMode) MarshalJSON() ([]byte, error)

type RunTask

type RunTask struct {
	TaskMeta
	Image                  string       `json:"image,omitempty"`
	Command                string       `json:"command,omitempty"`
	Shell                  string       `json:"shell,omitempty"`
	Script                 string       `json:"script,omitempty"`
	Entrypoint             string       `json:"entrypoint,omitempty"`
	User                   string       `json:"user,omitempty"`
	Workspace              string       `json:"workspace,omitempty"`
	Hostname               string       `json:"hostname,omitempty"`
	Detach                 bool         `json:"detach,omitempty"`
	Healthcheck            *Healthcheck `json:"healthcheck,omitempty"`
	ExportEnvironmentFiles []string     `json:"export-environment-files,omitempty"`
}

func (*RunTask) Extend

func (t *RunTask) Extend(task Task) error

func (*RunTask) GetType

func (t *RunTask) GetType() string

func (*RunTask) MarshalJSON

func (t *RunTask) MarshalJSON() ([]byte, error)

type ServerRegistry

type ServerRegistry struct {
	Server       string `json:"server,omitempty"`
	Username     string `json:"username,omitempty"`
	Password     string `json:"password,omitempty"`
	PasswordFile string `json:"password-file,omitempty"`
}

func (*ServerRegistry) GetType

func (r *ServerRegistry) GetType() string

type Stage

type Stage struct {
	Name        string       `json:"name,omitempty"`
	Disabled    string       `json:"disabled,omitempty"`
	BeforeStage string       `json:"before-stage,omitempty"`
	AfterStage  string       `json:"after-stage,omitempty"`
	RunMode     RunMode      `json:"run-mode,omitempty"`
	Parallel    bool         `json:"parallel,omitempty"`
	Environment []string     `json:"environment,omitempty"`
	Tasks       []*StageTask `json:"tasks,omitempty"`
}

func (*Stage) ShouldRun

func (s *Stage) ShouldRun(failure bool) bool

type StageTask

type StageTask struct {
	Name        string   `json:"name,omitempty"`
	Disabled    string   `json:"disabled,omitempty"`
	Environment []string `json:"environment,omitempty"`
}

type Task

type Task interface {
	GetName() string
	GetType() string
	GetExtends() string
	GetEnvironment() []string
	GetRequiredEnvironment() []string
	Extend(parent Task) error
}

type TaskExtendsResolver

type TaskExtendsResolver struct {
	// contains filtered or unexported fields
}

func NewTaskExtendsResolver

func NewTaskExtendsResolver(config *Config) *TaskExtendsResolver

func (*TaskExtendsResolver) Add

func (r *TaskExtendsResolver) Add(task Task)

func (*TaskExtendsResolver) Resolve

func (r *TaskExtendsResolver) Resolve() error

type TaskMeta

type TaskMeta struct {
	Name                string   `json:"-"`
	Extends             string   `json:"extends,omitempty"`
	Environment         []string `json:"environment,omitempty"`
	RequiredEnvironment []string `json:"required-environment,omitempty"`
}

func (*TaskMeta) GetEnvironment

func (t *TaskMeta) GetEnvironment() []string

func (*TaskMeta) GetExtends

func (t *TaskMeta) GetExtends() string

func (*TaskMeta) GetName

func (t *TaskMeta) GetName() string

func (*TaskMeta) GetRequiredEnvironment

func (t *TaskMeta) GetRequiredEnvironment() []string

Jump to

Keyboard shortcuts

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