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`)
## `envTemplate`: uses values of environment variables as tags
89
94
@@ -176,4 +181,21 @@ Suppose the current time is `15:04:09.999 January 2nd, 2006` and the abbreviated
176
181
177
182
The tag template uses the [Golang Templating Syntax](https://golang.org/pkg/text/template/).
178
183
As showcased in the example, `customTemplate` tag policy features one
179
-
**required** parameter, `template`, which is the tag template to use. To learn more about templating support in the skaffold.yaml, see [Templated fields]({{< relref "../environment/templating.md" >}})
184
+
**required** parameter, `template`, which is the tag template to use. To learn more about templating support in the skaffold.yaml, see [Templated fields]({{< relref "../environment/templating.md" >}})
185
+
186
+
## `sha256`: uses `latest` to tag images
187
+
188
+
`sha256` is a misleading name. It is named like that because, in the end, when Skaffold
189
+
deploys to a remote cluster, the image's `sha256` digest is used in addition to `:latest`
190
+
in order to create an immutable image reference.
191
+
192
+
### Example
193
+
194
+
The following `build` section instructs Skaffold to build a
195
+
Docker image `gcr.io/k8s-skaffold/example` with the `sha256` tag policy:
Copy file name to clipboardExpand all lines: docs/content/en/schemas/v2beta17.json
+4-4
Original file line number
Diff line number
Diff line change
@@ -1689,14 +1689,14 @@
1689
1689
},
1690
1690
"skipBuildDependencies": {
1691
1691
"type": "boolean",
1692
-
"description": "should build dependencies be skipped. Ignored when `remote: true`.",
1693
-
"x-intellij-html-description": "should build dependencies be skipped. Ignored when <code>remote: true</code>.",
1692
+
"description": "should build dependencies be skipped. Ignored for `remoteChart`.",
1693
+
"x-intellij-html-description": "should build dependencies be skipped. Ignored for <code>remoteChart</code>.",
1694
1694
"default": "false"
1695
1695
},
1696
1696
"upgradeOnChange": {
1697
1697
"type": "boolean",
1698
-
"description": "specifies whether to upgrade helm chart on code changes. Default is `true` when helm chart is local (`remote: false`). Default is `false` if `remote: true`.",
1699
-
"x-intellij-html-description": "specifies whether to upgrade helm chart on code changes. Default is <code>true</code> when helm chart is local (<code>remote: false</code>). Default is <code>false</code> if <code>remote: true</code>."
1698
+
"description": "specifies whether to upgrade helm chart on code changes. Default is `true` when helm chart is local (has `chartPath`). Default is `false` when helm chart is remote (has `remoteChart`).",
1699
+
"x-intellij-html-description": "specifies whether to upgrade helm chart on code changes. Default is <code>true</code> when helm chart is local (has <code>chartPath</code>). Default is <code>false</code> when helm chart is remote (has <code>remoteChart</code>)."
0 commit comments