/
schema.go
141 lines (126 loc) 路 5.52 KB
/
schema.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
package config
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 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 Components struct {
Terraform Terraform
Helmfile Helmfile
}
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 Workflows struct {
BasePath string `yaml:"base_path" json:"base_path" mapstructure:"base_path"`
}
type Logs struct {
Verbose bool `yaml:"verbose" json:"verbose" mapstructure:"verbose"`
Colors bool `yaml:"colors" json:"colors" mapstructure:"colors"`
}
type Configuration struct {
BasePath string `yaml:"base_path" json:"base_path" mapstructure:"base_path"`
Components Components
Stacks Stacks
Workflows Workflows
Logs Logs
}
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 Context struct {
Namespace string
Tenant string
Environment string
Stage string
Region string
Component string
BaseComponent string
}
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 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 WorkflowStep struct {
Command string `yaml:"command" json:"command" mapstructure:"command"`
Stack string `yaml:"stack" json:"stack" mapstructure:"stack"`
Type string `yaml:"type" json:"type" mapstructure:"type"`
}
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 WorkflowConfig map[string]WorkflowDefinition
type WorkflowFile map[string]WorkflowConfig