config

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Build

type Build struct {
	Context     string            `yaml:"context"`
	RegistryURL string            `yaml:"registry_url"`
	Name        string            `yaml:"name" validate:"omitempty,min=3"`
	Tags        []string          `yaml:"tags"`
	Push        bool              `yaml:"push"`
	Target      string            `yaml:"target" validate:"omitempty,alphanum"`
	File        string            `yaml:"file" validate:"omitempty,file"`
	DeployTag   string            `yaml:"deploy_tag"`
	Script      string            `yaml:"script"`
	BuildArgs   map[string]string `yaml:"build_args"`
}

Build configuration.

type Config

type Config struct {
	Name         string                 `yaml:"name" validate:"required,min=3"`
	Concurrent   bool                   `yaml:"concurrent"`
	Environments map[string]Environment `yaml:"environments" validate:"required,dive"`
	Deployments  map[string]Deployment  `yaml:"deployments" validate:"required,dive"`
}

Config for the overall setup.

func LoadFromFile

func LoadFromFile(file string) (Config, error)

LoadFromFile generates the config from a given yaml file.

type Deployment

type Deployment struct {
	Builds         map[string]Build  `yaml:"builds" validate:"dive"`
	NomadFile      string            `yaml:"nomad_file"`
	StartInstances int               `yaml:"start_instances" validate:"omitempty,min=1,max=10"`
	Variables      map[string]string `yaml:"variables"`
	ServiceName    string            `yaml:"service_name" validate:"omitempty,min=3"`
}

Deployment Configuration.

type Environment

type Environment struct {
	NomadURL  string            `yaml:"nomad_url" validate:"required,url"`
	Variables map[string]string `yaml:"variables"`
}

Environment configuration.

Jump to

Keyboard shortcuts

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