common

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2017 License: MIT Imports: 39 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StackTypeVpc      StackType = "vpc"
	StackTypeTarget             = "target"
	StackTypeCluster            = "cluster"
	StackTypeRepo               = "repo"
	StackTypeService            = "service"
	StackTypePipeline           = "pipeline"
	StackTypeBucket             = "bucket"
)

List of valid stack types

Variables

This section is empty.

Functions

func CreateStackName

func CreateStackName(stackType StackType, names ...string) string

CreateStackName will create a name for a stack

func GetStackOverrides added in v0.1.8

func GetStackOverrides(stackName string) interface{}

GetStackOverrides will get the overrides from the config

func GetVersion

func GetVersion() string

GetVersion returns the current version of the app

func MapApply added in v0.1.8

func MapApply(dest, src interface{})

MapApply recursively applies map values from source to destination

func SetVersion added in v0.1.3

func SetVersion(v string)

SetVersion returns the current version of the app

func SetupLogging

func SetupLogging(verbosity int)

SetupLogging - verbosity 0=error, 1=info, 2=debug

Types

type ClusterInstanceLister

type ClusterInstanceLister interface {
	ListInstances(clusterName string) ([]*ecs.ContainerInstance, error)
}

ClusterInstanceLister for getting cluster instances

type ClusterManager

type ClusterManager interface {
	ClusterInstanceLister
	RepositoryAuthenticator
}

ClusterManager composite of all cluster capabilities

type Config

type Config struct {
	Environments []Environment `yaml:"environments,omitempty"`
	Service      Service       `yaml:"service,omitempty"`
	Basedir      string        `yaml:"-"`
	Repo         struct {
		Name     string
		Slug     string
		Revision string
		Provider string
	} `yaml:"-"`
	Templates map[string]interface{} `yaml:"templates,omitempty"`
}

Config defines the structure of the yml file for the mu config

type Context

type Context struct {
	Config          Config
	StackManager    StackManager
	ClusterManager  ClusterManager
	ElbManager      ElbManager
	PipelineManager PipelineManager
	DockerManager   DockerManager
	DockerOut       io.Writer
}

Context defines the context object passed around

func NewContext

func NewContext() *Context

NewContext create a new context object

func (*Context) InitializeConfig added in v0.1.7

func (ctx *Context) InitializeConfig(configReader io.Reader) error

InitializeConfig loads config object

func (*Context) InitializeConfigFromFile added in v0.1.7

func (ctx *Context) InitializeConfigFromFile(muFile string) error

InitializeConfigFromFile loads config from file

func (*Context) InitializeContext added in v0.1.7

func (ctx *Context) InitializeContext(profile string, region string, dryrun bool) error

InitializeContext loads manager objects

type DockerImageBuilder added in v0.1.3

type DockerImageBuilder interface {
	ImageBuild(contextDir string, relDockerfile string, tags []string, dockerOut io.Writer) error
}

DockerImageBuilder for creating docker images

type DockerImagePusher added in v0.1.3

type DockerImagePusher interface {
	ImagePush(image string, registryAuth string, dockerOut io.Writer) error
}

DockerImagePusher for pushing docker images

type DockerManager added in v0.1.3

type DockerManager interface {
	DockerImageBuilder
	DockerImagePusher
}

DockerManager composite of all cluster capabilities

type ElbManager added in v0.1.7

type ElbManager interface {
	ElbRuleLister
}

ElbManager composite of all cluster capabilities

type ElbRuleLister added in v0.1.7

type ElbRuleLister interface {
	ListRules(listenerArn string) ([]*elbv2.Rule, error)
}

ElbRuleLister for getting cluster instances

type Environment

type Environment struct {
	Name         string `yaml:"name,omitempty"`
	Loadbalancer struct {
		HostedZone  string `yaml:"hostedzone,omitempty"`
		Name        string `yaml:"name,omitempty"`
		Certificate string `yaml:"certificate,omitempty"`
		Internal    bool   `yaml:"internal,omitempty"`
	} `yaml:"loadbalancer,omitempty"`
	Cluster struct {
		InstanceType      string `yaml:"instanceType,omitempty"`
		ImageID           string `yaml:"imageId,omitempty"`
		InstanceTenancy   string `yaml:"instanceTenancy,omitempty"`
		DesiredCapacity   int    `yaml:"desiredCapacity,omitempty"`
		MaxSize           int    `yaml:"maxSize,omitempty"`
		KeyName           string `yaml:"keyName,omitempty"`
		SSHAllow          string `yaml:"sshAllow,omitempty"`
		ScaleOutThreshold int    `yaml:"scaleOutThreshold,omitempty"`
		ScaleInThreshold  int    `yaml:"scaleInThreshold,omitempty"`
		HTTPProxy         string `yaml:"httpProxy,omitempty"`
	} `yaml:"cluster,omitempty"`
	VpcTarget struct {
		VpcID        string   `yaml:"vpcId,omitempty"`
		EcsSubnetIds []string `yaml:"ecsSubnetIds,omitempty"`
		ElbSubnetIds []string `yaml:"elbSubnetIds,omitempty"`
	} `yaml:"vpcTarget,omitempty"`
}

Environment defines the structure of the yml file for an environment

type ImageFinder

type ImageFinder interface {
	FindLatestImageID(namePattern string) (string, error)
}

ImageFinder for finding latest image

type Pipeline added in v0.1.5

type Pipeline struct {
	Source struct {
		Provider string `yaml:"provider,omitempty"`
		Repo     string `yaml:"repo,omitempty"`
		Branch   string `yaml:"branch,omitempty"`
	} `yaml:"source,omitempty"`
	Build struct {
		Type        string `yaml:"type,omitempty"`
		ComputeType string `yaml:"computeType,omitempty"`
		Image       string `yaml:"image,omitempty"`
	} `yaml:"build,omitempty"`
	Acceptance struct {
		Environment string `yaml:"environment,omitempty"`
		Type        string `yaml:"type,omitempty"`
		ComputeType string `yaml:"computeType,omitempty"`
		Image       string `yaml:"image,omitempty"`
	} `yaml:"acceptance,omitempty"`
	Production struct {
		Environment string `yaml:"environment,omitempty"`
	} `yaml:"production,omitempty"`
	MuBaseurl string `yaml:"muBaseurl,omitempty"`
	MuVersion string `yaml:"muVersion,omitempty"`
}

Pipeline definition

type PipelineManager added in v0.1.5

type PipelineManager interface {
	PipelineStateLister
}

PipelineManager composite of all cluster capabilities

type PipelineStateLister added in v0.1.5

type PipelineStateLister interface {
	ListState(pipelineName string) ([]*codepipeline.StageState, error)
}

PipelineStateLister for getting cluster instances

type RepositoryAuthenticator added in v0.1.3

type RepositoryAuthenticator interface {
	AuthenticateRepository(repoURL string) (string, error)
}

RepositoryAuthenticator auths for a repo

type Service

type Service struct {
	Name            string                 `yaml:"name,omitempty"`
	DesiredCount    int                    `yaml:"desiredCount,omitempty"`
	Dockerfile      string                 `yaml:"dockerfile,omitempty"`
	ImageRepository string                 `yaml:"imageRepository,omitempty"`
	Port            int                    `yaml:"port,omitempty"`
	HealthEndpoint  string                 `yaml:"healthEndpoint,omitempty"`
	CPU             int                    `yaml:"cpu,omitempty"`
	Memory          int                    `yaml:"memory,omitempty"`
	Environment     map[string]interface{} `yaml:"environment,omitempty"`
	PathPatterns    []string               `yaml:"pathPatterns,omitempty"`
	Priority        int                    `yaml:"priority,omitempty"`
	Pipeline        Pipeline               `yaml:"pipeline,omitempty"`
}

Service defines the structure of the yml file for a service

type Stack

type Stack struct {
	ID             string
	Name           string
	Status         string
	StatusReason   string
	LastUpdateTime time.Time
	Tags           map[string]string
	Outputs        map[string]string
	Parameters     map[string]string
}

Stack summary

type StackDeleter

type StackDeleter interface {
	DeleteStack(stackName string) error
}

StackDeleter for deleting stacks

type StackGetter

type StackGetter interface {
	GetStack(stackName string) (*Stack, error)
}

StackGetter for getting stacks

type StackLister

type StackLister interface {
	ListStacks(stackType StackType) ([]*Stack, error)
}

StackLister for listing stacks

type StackManager

StackManager composite of all stack capabilities

type StackType

type StackType string

StackType describes supported stack types

type StackUpserter

type StackUpserter interface {
	UpsertStack(stackName string, templateBodyReader io.Reader, parameters map[string]string, tags map[string]string) error
}

StackUpserter for applying changes to a stack

type StackWaiter

type StackWaiter interface {
	AwaitFinalStatus(stackName string) *Stack
}

StackWaiter for waiting on stack status to be final

Jump to

Keyboard shortcuts

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