deploy

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2021 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEPLOY_METHOD_UNKNOWN int = 0
	DEPLOY_METHOD_DOCKER  int = 1
	DEPLOY_METHOD_SHELL   int = 2
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Deployment   Deployment     `yaml:"deployment"`
	Global       Global         `yaml:"global"`
	Environments []*Environment `yaml:"environments"`
	// contains filtered or unexported fields
}

Config is the root structure for the deployment configuration

type Container

type Container struct {
	Repo string `yaml:"repo"`
	Tag  string `yaml:"tag"`
}

Container describes the container used for Docker deployments

type Deploy

type Deploy struct {
	// contains filtered or unexported fields
}

Deploy is the primary type for the stim deploy subcommand

func New

func New() *Deploy

New creates a new 'Deploy' object

func (*Deploy) BindStim

func (d *Deploy) BindStim(s *stim.Stim)

BindStim creates the stim object within this stimpack

func (*Deploy) Command

func (d *Deploy) Command(viper *viper.Viper) *cobra.Command

Command is required for every stimpack This function sets up the cli command parameters and returns the command

func (*Deploy) Deploy

func (d *Deploy) Deploy(environment *Environment, instance *Instance)

Deploy runs the deployment in the way that the user wants

func (*Deploy) DetermineDeployMethod added in v0.1.3

func (d *Deploy) DetermineDeployMethod() (int, error)

DetermineDeployMethod figures out the deploy method based on user input and availability

func (*Deploy) Name

func (d *Deploy) Name() string

Name is a required stim function that returns the name of the stimpack

func (*Deploy) Run

func (d *Deploy) Run()

Run is the main entrypoint to the "deploy" command

type Deployment

type Deployment struct {
	Directory       string    `yaml:"directory"`
	Script          string    `yaml:"script"`
	Container       Container `yaml:"container"`
	RequiredVersion string    `yaml:"requiredVersion"`
	MinimumVersion  string    `yaml:"minimumVersion"`
	// contains filtered or unexported fields
}

Deployment describes details about the deployment assets (directories, files, etc)

type Environment

type Environment struct {
	Name            string      `yaml:"name"`
	Spec            *Spec       `yaml:"spec"`
	Instances       []*Instance `yaml:"instances"`
	RemoveAllPrompt bool        `yaml:"removeAllPrompt"`
	// contains filtered or unexported fields
}

Environment describes a deployment environment (i.e. dev, stage, prod, etc.)

type EnvironmentVar

type EnvironmentVar struct {
	Name  string `yaml:"name"`
	Value string `yaml:"value"`
}

EnvironmentVar describes a shell env var to be injected into the deployment environment

type Global

type Global struct {
	Spec *Spec `yaml:"spec"`
}

Global describes global environment specs

type Instance

type Instance struct {
	Name string `yaml:"name"`
	Spec *Spec  `yaml:"spec"`
}

Instance describes an instance of a deployment within an environment (i.e. us-west-2 for env prod)

type Kubernetes

type Kubernetes struct {
	ServiceAccount string `yaml:"serviceAccount"`
	Cluster        string `yaml:"cluster"`
}

Kubernetes describes the Kubernetes configuration to use

type Spec

type Spec struct {
	Kubernetes            Kubernetes              `yaml:"kubernetes"`
	Secrets               []*v2e.SecretItem       `yaml:"secrets"`
	EnvironmentVars       []*EnvironmentVar       `yaml:"env"`
	AddConfirmationPrompt bool                    `yaml:"addConfirmationPrompt"`
	Tools                 map[string]stim.EnvTool `yaml:"tools"`
}

Spec contains the spec of a given environment/instance

Jump to

Keyboard shortcuts

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