config

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2016 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultFileNameYaml = "gci.yaml"
	DefaultFileNameYml  = "gci.yml"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Build

type Build struct {
	ImageName    string   `yaml:"image-name"`
	ImageTag     string   `yaml:"image-tag"`
	Gopath       string   `json:"gopath"`
	OutputBinary string   `yaml:"output-binary"`
	Env          []string `yaml:"env"`
}

Build is the configuration for a build

func (Build) GetOutputBinary

func (b Build) GetOutputBinary(pathBase string) string

type CustomTarget

type CustomTarget struct {
	Name        string   `yaml:"name"`
	Description string   `yaml:"description"`
	ImageName   string   `yaml:"image-name"`
	ImageTag    string   `yaml:"image-tag"`
	Command     string   `yaml:"command"`
	MountTarget string   `yaml:"mount-target"`
	Envs        []string `yaml:"environment"`
}

CustomTarget is a custom command that executes a set of commands in a container

type Docker

type Docker struct {
	ImageName string      `yaml:"image-name"`
	Tag       string      `yaml:"tag"`
	Build     DockerBuild `yaml:"build"`
	Push      DockerPush  `yaml:"push"`
}

func (Docker) GetTag

func (d Docker) GetTag() string

type DockerBuild

type DockerBuild struct {
	DockerfileLocation string             `yaml:"dockerfile-location"`
	Context            DockerBuildContext `yaml:"context"`
}

func (DockerBuild) GetDockerfileLocation

func (d DockerBuild) GetDockerfileLocation() string

type DockerBuildContext

type DockerBuildContext struct {
	Directory string   `yaml:"dir"`
	Skips     []string `yaml:"skip"`
}

func (DockerBuildContext) GetDirectory

func (d DockerBuildContext) GetDirectory() string

func (DockerBuildContext) GetSkips

func (d DockerBuildContext) GetSkips() map[string]struct{}

type DockerPush

type DockerPush struct {
	AuthFileLocation string `json:"auth-file-location"`
}

func (DockerPush) GetAuthFileLocation

func (d DockerPush) GetAuthFileLocation() string

type File

type File struct {
	Version string         `yaml:"version"`
	Build   Build          `yaml:"build"`
	Docker  Docker         `yaml:"docker"`
	Custom  []CustomTarget `yaml:"custom"`
}

File is the complete in-memory representation of a config file

func Empty

func Empty() *File

Empty returns an empty config file

func Read

func Read(name string) (*File, error)

Read attempts to get and decode the File at name. If name is empty, tries DefaultFileNameYaml and then defaultFileNameYml. If no file at name exists, or name was empty and neither DefaultFileNameYaml nor defaultFileNameYml exists, returns ErrNoFile

func ReadBytes

func ReadBytes(b []byte) (*File, error)

func ReadOrDie

func ReadOrDie(name string) *File

ReadOrDie calls Read and if it returned an error, logs and exits

func (File) String

func (f File) String() string

Jump to

Keyboard shortcuts

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