You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -89,6 +96,18 @@ Use the '--module' filter to specify the individual module to target. Otherwise,
89
96
NoArgs(addGcbBuildEnv)
90
97
}
91
98
99
+
funccmdBuildEnvAddLocal() *cobra.Command {
100
+
returnNewCmd("local").
101
+
WithDescription("Add a new Local build environment definition").
102
+
WithLongDescription(`Add a new Local build environment definition.
103
+
Without the '--profile' flag the new environment definition is added to the default pipeline. With the '--profile' flag it will create a new profile with this build env definition.
104
+
In these respective scenarios, it will fail if the build env definition for the default pipeline or the named profile already exists. To override an existing definition use 'skaffold inspect build-env modify' command instead.
105
+
Use the '--module' filter to specify the individual module to target. Otherwise, it'll be applied to all modules defined in the target file. Also, with the '--profile' flag if the target config imports other configs as dependencies, then the new profile will be recursively created in all the imported configs also.`).
106
+
WithExample("Add a new profile named 'local' targeting the local build environment with option to push images and using buildkit", "inspect build-env add local --profile local --push true --useBuildkit true -f skaffold.yaml").
107
+
WithFlagAdder(cmdBuildEnvLocalFlags).
108
+
NoArgs(addLocalBuildEnv)
109
+
}
110
+
92
111
funccmdBuildEnvAddCluster() *cobra.Command {
93
112
returnNewCmd("cluster").
94
113
WithDescription("Add a new Cluster build environment definition").
f.StringVarP(&buildEnvFlags.profile, "profile", "p", "", `Profile name to add the new build env definition in. If the profile name doesn't exist then the profile will be created in all the target configs. If this flag is not specified then the build env is added to the default pipeline of the target configs.`)
118
141
}
119
142
143
+
funccmdBuildEnvLocalFlags(f*pflag.FlagSet) {
144
+
varflags []*pflag.Flag
145
+
flags=append(flags, f.VarPF(&buildEnvFlags.push, "push", "", `Set to true to push images to a registry`))
146
+
flags=append(flags, f.VarPF(&buildEnvFlags.tryImportMissing, "tryImportMissing", "", `Set to true to to attempt importing artifacts from Docker (either a local or remote registry) if not in the build cache`))
147
+
flags=append(flags, f.VarPF(&buildEnvFlags.useDockerCLI, "useDockerCLI", "", `Set to true to use 'docker' command-line interface instead of Docker Engine APIs`))
148
+
flags=append(flags, f.VarPF(&buildEnvFlags.useBuildkit, "useBuildkit", "", `Set to true to use BuildKit to build Docker images`))
149
+
f.IntVar(&buildEnvFlags.concurrency, "concurrency", -1, `number of artifacts to build concurrently. 0 means "no-limit"`)
150
+
151
+
// support *bool flags without a value to be interpreted as `true`; like `--push` instead of `--push=true`
152
+
for_, f:=rangeflags {
153
+
f.NoOptDefVal="true"
154
+
}
155
+
}
156
+
120
157
funccmdBuildEnvAddGcbFlags(f*pflag.FlagSet) {
121
158
f.StringVar(&buildEnvFlags.projectID, "projectId", "", `ID of the Cloud Platform Project.`)
122
159
f.Int64Var(&buildEnvFlags.diskSizeGb, "diskSizeGb", 0, `Disk size of the VM that runs the build`)
0 commit comments