config

package
v2.1.1+incompatible Latest Latest
Warning

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

Go to latest
Published: May 26, 2019 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeMount

func DecodeMount(mounts []string, step *docker.Step) error

DecodeMount parses mount format for directories to be mounted as bind volumes

func ValidateMountDir

func ValidateMountDir(ctx context.Context, fl validator.FieldLevel) bool

ValidateMountDir verifies that mount values are in proper format <src>:<dest>:<mode> Format should match, <mode> is optional which is `readOnly` by default and `src` directory exists in host machine

Types

type Configs

type Configs struct {
	Tasks map[string][]Task `validate:"required,min=1,dive,keys,required,endkeys,required,min=1,required"`
}

Configs describes the parsed information from the dunner file

func GetConfigs

func GetConfigs(filename string) (*Configs, error)

GetConfigs reads and parses tasks from the dunner file

func (*Configs) Validate

func (configs *Configs) Validate() []error

Validate validates config and returns errors.

type Task

type Task struct {
	Name     string     `yaml:"name"`
	Image    string     `yaml:"image" validate:"required"`
	SubDir   string     `yaml:"dir"`
	Command  []string   `yaml:"command" validate:"omitempty,dive,required"`
	Commands [][]string `yaml:"commands"`
	Envs     []string   `yaml:"envs"`
	Mounts   []string   `yaml:"mounts" validate:"omitempty,dive,min=1,mountdir"`
	Follow   string     `yaml:"follow"`
	Args     []string   `yaml:"args"`
}

Task describes a single task to be run in a docker container

Jump to

Keyboard shortcuts

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