Documentation ¶
Index ¶
- Variables
- func GetContextPrefix(stack string, context Context, stackNamePattern string) (string, error)
- func InitConfig() error
- func ProcessConfig(configAndStacksInfo ConfigAndStacksInfo, checkStack bool) error
- func ProcessConfigForSpacelift() error
- func ReplaceContextTokens(context Context, pattern string) string
- type ArgsAndFlagsInfo
- type Components
- type ConfigAndStacksInfo
- type Configuration
- type Context
- type Helmfile
- type Logs
- type ProcessedConfiguration
- type Stacks
- type Terraform
- type WorkflowConfig
- type WorkflowDefinition
- type WorkflowFile
- type WorkflowStep
- type Workflows
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Config is the CLI configuration structure Config Configuration // ProcessedConfig holds all the calculated values ProcessedConfig ProcessedConfiguration )
Functions ¶
func GetContextPrefix ¶ added in v1.3.5
GetContextPrefix calculates context prefix from the context
func InitConfig ¶
func InitConfig() error
InitConfig finds and merges CLI configurations in the following order: system dir, home dir, current dir, ENV vars, command-line arguments https://dev.to/techschoolguru/load-config-from-file-environment-variables-in-golang-with-viper-2j2d https://medium.com/@bnprashanth256/reading-configuration-files-and-environment-variables-in-go-golang-c2607f912b63
func ProcessConfig ¶
func ProcessConfig(configAndStacksInfo ConfigAndStacksInfo, checkStack bool) error
ProcessConfig processes and checks CLI configuration
func ProcessConfigForSpacelift ¶ added in v1.3.5
func ProcessConfigForSpacelift() error
ProcessConfigForSpacelift processes config for Spacelift
func ReplaceContextTokens ¶ added in v1.3.5
ReplaceContextTokens replaces tokens in the context pattern
Types ¶
type ArgsAndFlagsInfo ¶
type ArgsAndFlagsInfo struct { AdditionalArgsAndFlags []string SubCommand string ComponentFromArg string GlobalOptions []string TerraformDir string HelmfileDir string ConfigDir string StacksDir string WorkflowsDir string BasePath string DeployRunInit string InitRunReconfigure string AutoGenerateBackendFile string UseTerraformPlan bool DryRun bool NeedHelp bool }
type Components ¶
type ConfigAndStacksInfo ¶
type ConfigAndStacksInfo struct { StackFromArg string Stack string ComponentType string ComponentFromArg string Component string ComponentFolderPrefix string BaseComponentPath string BaseComponent string FinalComponent string Command string SubCommand string ComponentSection map[string]interface{} ComponentVarsSection map[interface{}]interface{} ComponentEnvSection map[interface{}]interface{} ComponentEnvList []string ComponentBackendSection map[interface{}]interface{} ComponentBackendType string AdditionalArgsAndFlags []string GlobalOptions []string BasePath string TerraformDir string HelmfileDir string ConfigDir string StacksDir string WorkflowsDir string Context Context ContextPrefix string DeployRunInit string InitRunReconfigure string AutoGenerateBackendFile string UseTerraformPlan bool DryRun bool ComponentInheritanceChain []string NeedHelp bool ComponentIsAbstract bool ComponentMetadataSection map[interface{}]interface{} TerraformWorkspace string }
type Configuration ¶
type Configuration struct { BasePath string `yaml:"base_path" json:"base_path" mapstructure:"base_path"` Components Components Stacks Stacks Workflows Workflows Logs Logs }
type Context ¶
type Context struct { Namespace string Tenant string Environment string Stage string Region string Component string }
func GetContextFromVars ¶ added in v1.3.5
func GetContextFromVars(vars map[interface{}]interface{}) Context
GetContextFromVars creates a context object from the provided variables
type Helmfile ¶
type Helmfile struct { BasePath string `yaml:"base_path" json:"base_path" mapstructure:"base_path"` KubeconfigPath string `yaml:"kubeconfig_path" json:"kubeconfig_path" mapstructure:"kubeconfig_path"` HelmAwsProfilePattern string `yaml:"helm_aws_profile_pattern" json:"helm_aws_profile_pattern" mapstructure:"helm_aws_profile_pattern"` ClusterNamePattern string `yaml:"cluster_name_pattern" json:"cluster_name_pattern" mapstructure:"cluster_name_pattern"` }
type ProcessedConfiguration ¶
type ProcessedConfiguration struct { StacksBaseAbsolutePath string `yaml:"StacksBaseAbsolutePath" json:"StacksBaseAbsolutePath"` IncludeStackAbsolutePaths []string `yaml:"IncludeStackAbsolutePaths" json:"IncludeStackAbsolutePaths"` ExcludeStackAbsolutePaths []string `yaml:"ExcludeStackAbsolutePaths" json:"ExcludeStackAbsolutePaths"` TerraformDirAbsolutePath string `yaml:"TerraformDirAbsolutePath" json:"TerraformDirAbsolutePath"` HelmfileDirAbsolutePath string `yaml:"HelmfileDirAbsolutePath" json:"HelmfileDirAbsolutePath"` StackConfigFilesRelativePaths []string `yaml:"StackConfigFilesRelativePaths" json:"StackConfigFilesRelativePaths"` StackConfigFilesAbsolutePaths []string `yaml:"StackConfigFilesAbsolutePaths" json:"StackConfigFilesAbsolutePaths"` StackType string `yaml:"StackType" json:"StackType"` }
type Stacks ¶
type Stacks struct { BasePath string `yaml:"base_path" json:"base_path" mapstructure:"base_path"` IncludedPaths []string `yaml:"included_paths" json:"included_paths" mapstructure:"included_paths"` ExcludedPaths []string `yaml:"excluded_paths" json:"excluded_paths" mapstructure:"excluded_paths"` NamePattern string `yaml:"name_pattern" json:"name_pattern" mapstructure:"name_pattern"` }
type Terraform ¶
type Terraform struct { BasePath string `yaml:"base_path" json:"base_path" mapstructure:"base_path"` ApplyAutoApprove bool `yaml:"apply_auto_approve" json:"apply_auto_approve" mapstructure:"apply_auto_approve"` DeployRunInit bool `yaml:"deploy_run_init" json:"deploy_run_init" mapstructure:"deploy_run_init"` InitRunReconfigure bool `yaml:"init_run_reconfigure" json:"init_run_reconfigure" mapstructure:"init_run_reconfigure"` AutoGenerateBackendFile bool `yaml:"auto_generate_backend_file" json:"auto_generate_backend_file" mapstructure:"auto_generate_backend_file"` }
type WorkflowConfig ¶ added in v1.4.0
type WorkflowConfig map[string]WorkflowDefinition
type WorkflowDefinition ¶ added in v1.4.0
type WorkflowDefinition struct { Description string `yaml:"description" json:"description" mapstructure:"description"` Steps []WorkflowStep `yaml:"steps" json:"steps" mapstructure:"steps"` Stack string `yaml:"stack" json:"stack" mapstructure:"stack"` }
type WorkflowFile ¶ added in v1.4.0
type WorkflowFile map[string]WorkflowConfig
type WorkflowStep ¶ added in v1.4.0
Click to show internal directories.
Click to hide internal directories.