release

package
v0.0.0-...-d31700d Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2022 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Arg1Call

func Arg1Call(arg1 string, work func(string) error) cmdFunc

func BashQuote

func BashQuote(original string) string

func CheckEnv

func CheckEnv(env string) (string, error)

func Config

func Config(env string) *config.Config

func ContainerNameRegexp

func ContainerNameRegexp(svcName, env string) string

func Env1Call

func Env1Call(work func(string, string) error) cmdFunc

func Env2Call

func Env2Call(work func(string, string, string) error) cmdFunc

func EnvCall

func EnvCall(work func(string) error) cmdFunc

func EnvSliceCall

func EnvSliceCall(work func(string, []string) error) cmdFunc

optional env, and optional signle argument slice seperated by "--"

func EnvSlicesCall

func EnvSlicesCall(work func(string, [][]string) error) cmdFunc

optional env, and optional multiple argument slices seperated by "--"

func GetClusters

func GetClusters(env string) map[string]*Cluster

func GoCmd

func GoCmd() string

func GoGetByProxy

func GoGetByProxy(args ...string) error

func HasService

func HasService(env, svcName string) bool

func ImageDir

func ImageDir(env, svcName string) string

func InProject

func InProject(env string) bool

func IsCurrentUser

func IsCurrentUser(users string) (bool, error)

func ModulePath

func ModulePath() (string, error)

func MultiPorts

func MultiPorts(env string, svcNames []string) bool

func Name

func Name(env string) string

func NoArgCall

func NoArgCall(work func() error) cmdFunc

func ProjectRoot

func ProjectRoot() string

func Root

func Root(env string) string

Root returns an environment's root directory of release config.

func ServiceName

func ServiceName(env, svcName string) string

func ServiceNames

func ServiceNames(env string) (names []string)

func SrcDir

func SrcDir() string

func TimeTag

func TimeTag(env string) string

Types

type Cluster

type Cluster struct {
	User  string `yaml:"user"`
	Nodes []Node `yaml:"nodes"`
	// contains filtered or unexported fields
}

func GetCluster

func GetCluster(env string) *Cluster

func (Cluster) GetNodes

func (c Cluster) GetNodes(feature string) (nodes []Node)

func (Cluster) IsLocalHost

func (c Cluster) IsLocalHost() (bool, error)

func (Cluster) List

func (c Cluster) List()

func (Cluster) NodesCount

func (c Cluster) NodesCount() int

func (Cluster) Run

func (c Cluster) Run(feature string, o cmd.O, script string) (string, error)

func (Cluster) ServiceRun

func (c Cluster) ServiceRun(svcName, feature string, o cmd.O, script string) (string, error)

type Deploy

type Deploy struct {
	AccessNodes     map[string]string   `yaml:"accessNodes"`
	Services        map[string]*Service `yaml:"services"`
	VolumesToCreate []string            `yaml:"volumesToCreate"`
}

func GetDeploy

func GetDeploy(env string) *Deploy

type Node

type Node struct {

	// addr for ssh and service may be on different network segments.
	Addr        string            `yaml:"addr"`       // addr for ssh
	ServiceAddr string            `yaml:"seviceAddr"` // addr for service, use Addr if empty.
	Labels      map[string]string `yaml:"labels"`
	// contains filtered or unexported fields
}

func (Node) GetServiceAddr

func (n Node) GetServiceAddr() string

func (Node) IsLocalHost

func (n Node) IsLocalHost() (bool, error)

func (Node) IsLocalHostP

func (n Node) IsLocalHostP() bool

func (Node) Match

func (n Node) Match(labels map[string]string) bool

func (Node) Run

func (n Node) Run(o cmd.O, script string) (string, error)

func (Node) Services

func (n Node) Services(env, svcName string) []string

func (Node) SshAddr

func (n Node) SshAddr() string

func (Node) SshCmd

func (n Node) SshCmd() string

type Service

type Service struct {
	Nodes            map[string]string
	Image            string
	Ports            []uint16
	Command, Options []string
	// contains filtered or unexported fields
}

func GetService

func GetService(env, svcName string) *Service

func (Service) FirstContainerName

func (svc Service) FirstContainerName() string

func (Service) ImageName

func (svc Service) ImageName(tag string) string

Jump to

Keyboard shortcuts

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