Merge pull request #40120 from ixdy/bazel-release-tars

Automatic merge from submit-queue

bazel: add a config setting to control embedding kubernetes-src.tar.gz

**What this PR does / why we need it**: currently a change anywhere in the tree will cause `kubernetes-src.tar.gz` to need to be regenerated, and thus also the server and node tarballs. All of these operations are slow, so for the sake of developer productivity, only include `kubernetes-src.tar.gz` when we need it (e.g. if we were doing a real release).

I don't have metrics on how much of an effect this has, but I expect it should help incremental builds, especially those that don't affect any node/server targets.

To embed the srcs tarball with this change, you'd run
```console
bazel build //build/release-tars --define EMBED_LICENSE_TARGETS=true
```

**Release note**:

```release-note
NONE
```
This commit is contained in:
Kubernetes Submit Queue 2017-01-20 16:19:09 -08:00 committed by GitHub
commit a374d277a6

View File

@ -15,6 +15,14 @@ filegroup(
tags = ["automanaged"],
)
config_setting(
name = "embed_license_targets",
values = {
"define": "EMBED_LICENSE_TARGETS=true",
},
visibility = ["//visibility:private"],
)
pkg_tar(
name = "kubernetes-src",
extension = "tar.gz",
@ -116,7 +124,10 @@ pkg_tar(
pkg_tar(
name = "kubernetes-node-%s" % PLATFORM_ARCH_STRING,
extension = "tar.gz",
files = LICENSE_TARGETS,
files = select({
":embed_license_targets": LICENSE_TARGETS,
"//conditions:default": [],
}),
mode = "0644",
package_dir = "kubernetes",
deps = [
@ -153,7 +164,10 @@ pkg_tar(
pkg_tar(
name = "kubernetes-server-%s" % PLATFORM_ARCH_STRING,
extension = "tar.gz",
files = LICENSE_TARGETS,
files = select({
":embed_license_targets": LICENSE_TARGETS,
"//conditions:default": [],
}),
mode = "0644",
package_dir = "kubernetes",
deps = [
@ -197,14 +211,17 @@ pkg_tar(
name = "kubernetes",
extension = "tar.gz",
files = [
"//:Godeps/LICENSES",
# TODO: the version file
"//:README.md",
"//:Vagrantfile",
"//cluster:all-srcs",
"//docs:all-srcs",
"//examples:all-srcs",
"//third_party/htpasswd:all-srcs",
],
] + select({
":embed_license_targets": ["//:Godeps/LICENSES"],
"//conditions:default": [],
}),
package_dir = "kubernetes",
strip_prefix = "//",
deps = [