/
cmd_data.go
151 lines (121 loc) · 5.64 KB
/
cmd_data.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
142
143
144
145
146
147
148
149
150
151
package common
import (
"fmt"
"os"
"github.com/spf13/cobra"
"github.com/werf/werf/pkg/util"
)
type CmdData struct {
GitWorkTree *string
ProjectName *string
Dir *string
ConfigPath *string
ConfigTemplatesDir *string
TmpDir *string
HomeDir *string
SSHKeys *[]string
SkipDependenciesRepoRefresh *bool
HelmChartDir *string
Environment *string
Release *string
Namespace *string
AddAnnotations *[]string
AddLabels *[]string
KubeContext *string
KubeConfig *string
KubeConfigBase64 *string
KubeConfigPathMergeList *[]string
StatusProgressPeriodSeconds *int64
HooksStatusProgressPeriodSeconds *int64
ReleasesHistoryMax *int
SetDockerConfigJsonValue *bool
Set *[]string
SetString *[]string
Values *[]string
SetFile *[]string
SecretValues *[]string
IgnoreSecretKey *bool
DisableDefaultValues *bool
DisableDefaultSecretValues *bool
HelmCompatibleChart *bool
RenameChart *string
WithoutImages *bool
Repo *RepoData
FinalRepo *RepoData
SecondaryStagesStorage *[]string
CacheStagesStorage *[]string
SkipBuild *bool
StubTags *bool
AddCustomTag *[]string
UseCustomTag *string
Synchronization *string
Parallel *bool
ParallelTasksLimit *int64
DockerConfig *string
InsecureRegistry *bool
SkipTlsVerifyRegistry *bool
InsecureHelmDependencies *bool
DryRun *bool
KeepStagesBuiltWithinLastNHours *uint64
WithoutKube *bool
LooseGiterminism *bool
Dev *bool
DevIgnore *[]string
DevBranch *string
IntrospectBeforeError *bool
IntrospectAfterError *bool
StagesToIntrospect *[]string
Follow *bool
LogDebug *bool
LogPretty *bool
LogVerbose *bool
LogQuiet *bool
LogColorMode *string
LogProjectDir *bool
LogTerminalWidth *int64
DeprecatedReportPath *string
DeprecatedReportFormat *string
BuildReportPath *string
BuildReportFormat *string
DeployReportPath *string
VirtualMerge *bool
ScanContextNamespaceOnly *bool
// Host storage cleanup options
DisableAutoHostCleanup *bool
DockerServerStoragePath *string
AllowedDockerStorageVolumeUsage *uint
AllowedDockerStorageVolumeUsageMargin *uint
AllowedLocalCacheVolumeUsage *uint
AllowedLocalCacheVolumeUsageMargin *uint
Platform *string
}
func (cmdData *CmdData) SetupWithoutImages(cmd *cobra.Command) {
cmdData.WithoutImages = new(bool)
cmd.Flags().BoolVarP(cmdData.WithoutImages, "without-images", "", util.GetBoolEnvironmentDefaultFalse("WERF_WITHOUT_IMAGES"), "Disable building of images defined in the werf.yaml (if any) and usage of such images in the .helm/templates ($WERF_WITHOUT_IMAGES or false by default — e.g. enable all images defined in the werf.yaml by default)")
}
func (cmdData *CmdData) SetupDisableDefaultValues(cmd *cobra.Command) {
cmdData.DisableDefaultValues = new(bool)
cmd.Flags().BoolVarP(cmdData.DisableDefaultValues, "disable-default-values", "", util.GetBoolEnvironmentDefaultFalse("WERF_DISABLE_DEFAULT_VALUES"), `Do not use values from the default .helm/values.yaml file (default $WERF_DISABLE_DEFAULT_VALUES or false)`)
}
func (cmdData *CmdData) SetupDisableDefaultSecretValues(cmd *cobra.Command) {
cmdData.DisableDefaultSecretValues = new(bool)
cmd.Flags().BoolVarP(cmdData.DisableDefaultSecretValues, "disable-default-secret-values", "", util.GetBoolEnvironmentDefaultFalse("WERF_DISABLE_DEFAULT_SECRET_VALUES"), `Do not use secret values from the default .helm/secret-values.yaml file (default $WERF_DISABLE_DEFAULT_SECRET_VALUES or false)`)
}
func (cmdData *CmdData) SetupSkipDependenciesRepoRefresh(cmd *cobra.Command) {
cmdData.SkipDependenciesRepoRefresh = new(bool)
cmd.Flags().BoolVarP(cmdData.SkipDependenciesRepoRefresh, "skip-dependencies-repo-refresh", "L", util.GetBoolEnvironmentDefaultFalse("WERF_SKIP_DEPENDENCIES_REPO_REFRESH"), `Do not refresh helm chart repositories locally cached index`)
}
func (cmdData *CmdData) SetupHelmCompatibleChart(cmd *cobra.Command, defaultEnabled bool) {
cmdData.HelmCompatibleChart = new(bool)
var defaultVal bool
if defaultEnabled {
defaultVal = util.GetBoolEnvironmentDefaultTrue("WERF_HELM_COMPATIBLE_CHART")
} else {
defaultVal = util.GetBoolEnvironmentDefaultFalse("WERF_HELM_COMPATIBLE_CHART")
}
cmd.Flags().BoolVarP(cmdData.HelmCompatibleChart, "helm-compatible-chart", "C", defaultVal, fmt.Sprintf(`Set chart name in the Chart.yaml of the published chart to the last path component of container registry repo (for REGISTRY/PATH/TO/REPO address chart name will be REPO, more info https://helm.sh/docs/topics/registries/#oci-feature-deprecation-and-behavior-changes-with-v370). In helm compatibility mode chart is fully conforming with the helm OCI registry requirements. Default %v or $WERF_HELM_COMPATIBLE_CHART.`, defaultEnabled))
}
func (cmdData *CmdData) SetupRenameChart(cmd *cobra.Command) {
cmdData.RenameChart = new(string)
cmd.Flags().StringVarP(cmdData.RenameChart, "rename-chart", "", os.Getenv("WERF_RENAME_CHART"), `Force setting of chart name in the Chart.yaml of the published chart to the specified value (can be set by the $WERF_RENAME_CHART, no rename by default, could not be used together with the '--helm-compatible-chart' option).`)
}