deploy

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2022 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BindFlags

func BindFlags(flags *pflag.FlagSet)

func InDependencyOrder

func InDependencyOrder(ctx context.Context, services *Services, fn func(context.Context, string) error) error

InDependencyOrder applies the function to the services of the project taking in account the dependency order

func NewCmdDeploy

func NewCmdDeploy() *cobra.Command

func NewCmdDeployInfra

func NewCmdDeployInfra() *cobra.Command

Types

type DeployInfraOptions

type DeployInfraOptions struct {
	Config    *config.Config
	Type      string
	Terraform terraformInfraConfig
}

func NewDeployInfraFlags

func NewDeployInfraFlags() *DeployInfraOptions

func (*DeployInfraOptions) Complete

func (o *DeployInfraOptions) Complete(cmd *cobra.Command, args []string) error

func (*DeployInfraOptions) Run

func (o *DeployInfraOptions) Run() error

func (*DeployInfraOptions) Validate

func (o *DeployInfraOptions) Validate() error

type DeployOptions

type DeployOptions struct {
	Config           *config.Config
	ServiceName      string
	Tag              string
	SkipBuildAndPush bool
	Services         Services
	Infra            Infra
	Service          ecsdeploy.Service
	AutoApprove      bool
}

func NewDeployFlags

func NewDeployFlags() *DeployOptions

func (*DeployOptions) Complete

func (o *DeployOptions) Complete(cmd *cobra.Command, args []string) error

func (*DeployOptions) Run

func (o *DeployOptions) Run() error

func (*DeployOptions) Validate

func (o *DeployOptions) Validate() error

type Graph

type Graph struct {
	Vertices map[string]*Vertex
	// contains filtered or unexported fields
}

Graph represents project as service dependencies

func NewGraph

func NewGraph(services Services, initialStatus ServiceStatus) *Graph

NewGraph returns the dependency graph of the services

func (*Graph) AddEdge

func (g *Graph) AddEdge(source string, destination string) error

func (*Graph) AddVertex

func (g *Graph) AddVertex(key string, service string, initialStatus ServiceStatus)

func (*Graph) FilterChildren

func (g *Graph) FilterChildren(key string, status ServiceStatus) []*Vertex

FilterChildren returns children of a certain vertex that are in a certain status

func (*Graph) HasCycles

func (g *Graph) HasCycles() (bool, error)

HasCycles detects cycles in the graph

func (*Graph) Leaves

func (g *Graph) Leaves() []*Vertex

Leaves returns the slice of leaves of the graph

func (*Graph) UpdateStatus

func (g *Graph) UpdateStatus(key string, status ServiceStatus)

UpdateStatus updates the status of a certain vertex

type Infra

type Infra struct {
	Version string `mapstructure:"terraform_version"`
	Region  string `mapstructure:"aws_region"`
	Profile string `mapstructure:"aws_profile"`
}

type ServiceStatus

type ServiceStatus int

ServiceStatus indicates the status of a service

const (
	ServiceStopped ServiceStatus = iota
	ServiceStarted
)

Services status flags

type Services

type Services map[string]*ecsdeploy.Service

type Vertex

type Vertex struct {
	Key      string
	Service  string
	Status   ServiceStatus
	Children map[string]*Vertex
	Parents  map[string]*Vertex
}

Vertex represents a service in the dependencies structure

func NewVertex

func NewVertex(key string, service string, initialStatus ServiceStatus) *Vertex

func (*Vertex) GetParents

func (v *Vertex) GetParents() []*Vertex

GetParents returns a slice with the parent vertexes of the a Vertex

Jump to

Keyboard shortcuts

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