config

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigureCmdWithBootstrapConfig added in v0.3.0

func ConfigureCmdWithBootstrapConfig(cmd *cobra.Command)

RequireBootstrap wraps a command adding flags to resolve bootstrap configuration. NOTE that these can also be set by the environment and follow a pre-established convention of precedence. NOTE this should typically be called in a cobra commands init sequence.

func FindDockerComposeFile added in v0.4.0

func FindDockerComposeFile(bootstrap *Bootstrap, fileName string) (string, error)

func FindFile added in v0.4.0

func FindFile(fileName string, paths []string) (string, error)

Types

type Bootstrap added in v0.3.0

type Bootstrap struct {
	HappyConfigPath  string `envconfig:"HAPPY_CONFIG_PATH" validate:"required"`
	HappyProjectRoot string `envconfig:"HAPPY_PROJECT_ROOT" validate:"required"`

	DockerComposeConfigPath string `envconfig:"DOCKER_COMPOSE_CONFIG_PATH" validate:"required"`

	Env string `envconfig:"HAPPY_ENV" validate:"required"`
}

func NewBootstrapConfig added in v0.3.0

func NewBootstrapConfig() (*Bootstrap, error)

func (*Bootstrap) GetComposeEnvFile added in v0.4.0

func (b *Bootstrap) GetComposeEnvFile() string

func (*Bootstrap) GetDockerComposeConfigPath added in v0.3.0

func (b *Bootstrap) GetDockerComposeConfigPath() string

func (*Bootstrap) GetEnv added in v0.3.0

func (b *Bootstrap) GetEnv() string

func (*Bootstrap) GetHappyConfigPath added in v0.3.0

func (b *Bootstrap) GetHappyConfigPath() string

func (*Bootstrap) GetHappyProjectRootPath added in v0.3.0

func (b *Bootstrap) GetHappyProjectRootPath() string

type ConfigData

type ConfigData struct {
	ConfigVersion         string                 `yaml:"config_version"`
	TerraformVersion      string                 `yaml:"terraform_version"`
	DefaultEnv            string                 `yaml:"default_env"`
	App                   string                 `yaml:"app"`
	DefaultComposeEnvFile string                 `yaml:"default_compose_env_file"`
	Environments          map[string]Environment `yaml:"environments"`
	Tasks                 map[string][]string    `yaml:"tasks"`
	SliceDefaultTag       string                 `yaml:"slice_default_tag"`
	Slices                map[string]Slice       `yaml:"slices"`
	Services              []string               `yaml:"services"`
}

type Environment

type Environment struct {
	AWSProfile         string     `yaml:"aws_profile"`
	SecretARN          string     `yaml:"secret_arn"`
	TerraformDirectory string     `yaml:"terraform_directory"`
	DeleteProtected    bool       `yaml:"delete_protected"`
	AutoRunMigration   bool       `yaml:"auto_run_migration"`
	LogGroupPrefix     string     `yaml:"log_group_prefix"`
	TaskLaunchType     LaunchType `yaml:"task_launch_type"`
}

type HappyConfig

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

func NewHappyConfig

func NewHappyConfig(ctx context.Context, bootstrap *Bootstrap) (*HappyConfig, error)

func (*HappyConfig) App

func (s *HappyConfig) App() string

func (*HappyConfig) AutoRunMigration

func (s *HappyConfig) AutoRunMigration() bool

func (*HappyConfig) AwsProfile

func (s *HappyConfig) AwsProfile() string

func (*HappyConfig) DefaultComposeEnvFile added in v0.4.0

func (s *HappyConfig) DefaultComposeEnvFile() string

func (*HappyConfig) DefaultEnv

func (s *HappyConfig) DefaultEnv() string

func (*HappyConfig) GetComposeEnvFile added in v0.4.0

func (s *HappyConfig) GetComposeEnvFile() string

func (*HappyConfig) GetDockerRepo added in v0.3.0

func (s *HappyConfig) GetDockerRepo() string

func (*HappyConfig) GetEnv added in v0.3.0

func (s *HappyConfig) GetEnv() string

func (*HappyConfig) GetProjectRoot added in v0.3.0

func (s *HappyConfig) GetProjectRoot() string

func (*HappyConfig) GetSecretArn

func (s *HappyConfig) GetSecretArn() string

func (*HappyConfig) GetServices added in v0.3.0

func (s *HappyConfig) GetServices() []string

func (*HappyConfig) GetSlices added in v0.3.0

func (s *HappyConfig) GetSlices() (map[string]Slice, error)

func (*HappyConfig) GetTasks

func (s *HappyConfig) GetTasks(taskType string) ([]string, error)

func (*HappyConfig) LogGroupPrefix

func (s *HappyConfig) LogGroupPrefix() string

func (*HappyConfig) SliceDefaultTag added in v0.3.0

func (s *HappyConfig) SliceDefaultTag() string

func (*HappyConfig) TaskLaunchType added in v0.3.0

func (s *HappyConfig) TaskLaunchType() LaunchType

func (*HappyConfig) TerraformDirectory

func (s *HappyConfig) TerraformDirectory() string

func (*HappyConfig) TerraformVersion

func (s *HappyConfig) TerraformVersion() string

type IntegrationSecret added in v0.4.0

type IntegrationSecret struct {
	ClusterArn     string                     `json:"cluster_arn"`
	PrivateSubnets []string                   `json:"private_subnets"`
	SecurityGroups []string                   `json:"security_groups"`
	Services       map[string]*RegistryConfig `json:"ecrs"`
	Tfe            *TfeSecret                 `json:"tfe"`
}

func (*IntegrationSecret) GetClusterArn added in v0.4.0

func (s *IntegrationSecret) GetClusterArn() string

func (*IntegrationSecret) GetPrivateSubnets added in v0.4.0

func (s *IntegrationSecret) GetPrivateSubnets() []string

func (*IntegrationSecret) GetSecurityGroups added in v0.4.0

func (s *IntegrationSecret) GetSecurityGroups() []string

func (*IntegrationSecret) GetServiceRegistries added in v0.4.0

func (s *IntegrationSecret) GetServiceRegistries() map[string]*RegistryConfig

func (*IntegrationSecret) GetServiceUrl added in v0.4.0

func (s *IntegrationSecret) GetServiceUrl(serviceName string) (string, error)

func (*IntegrationSecret) GetTfeOrg added in v0.4.0

func (s *IntegrationSecret) GetTfeOrg() string

func (*IntegrationSecret) GetTfeUrl added in v0.4.0

func (s *IntegrationSecret) GetTfeUrl() string

type LaunchType added in v0.4.0

type LaunchType string
const (
	LaunchTypeFargate LaunchType = "FARGATE"
	LaunchTypeEC2     LaunchType = "EC2"
)

func (LaunchType) String added in v0.4.0

func (l LaunchType) String() string

type RegistryConfig

type RegistryConfig struct {
	Url string `json:"url"`
}

func (*RegistryConfig) GetRegistryUrl

func (s *RegistryConfig) GetRegistryUrl() string

func (*RegistryConfig) GetRepoUrl

func (s *RegistryConfig) GetRepoUrl() string

type Slice added in v0.3.0

type Slice struct {
	BuildImages []string `yaml:"build_images"`
}

type TfeSecret added in v0.4.0

type TfeSecret struct {
	Url string `json:"url"`
	Org string `json:"org"`
}

Jump to

Keyboard shortcuts

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