Merge pull request #40561 from ixdy/bazel-src-tarball

Automatic merge from submit-queue (batch tested with PRs 40124, 39216, 40561, 40595, 40735)

Include a dummy src tarball unless PACKAGE_SRC=true is set

**What this PR does / why we need it**: alternative to #40546. I think this will keep the cluster startup scripts happy.

**Release note**:

```release-note
NONE
```
pull/6/head
Kubernetes Submit Queue 2017-02-01 12:32:48 -08:00 committed by GitHub
commit 17a78d941e
2 changed files with 28 additions and 20 deletions

View File

@ -512,5 +512,5 @@ bazel-release:
@echo "$$BAZEL_BUILD_HELP_INFO"
else
bazel-release:
bazel build //build/release-tars --define "EMBED_LICENSE_TARGETS=true"
bazel build //build/release-tars
endif

View File

@ -16,21 +16,37 @@ filegroup(
)
config_setting(
name = "embed_license_targets",
name = "package_src",
values = {
"define": "EMBED_LICENSE_TARGETS=true",
"define": "PACKAGE_SRC=true",
},
visibility = ["//visibility:private"],
)
genrule(
name = "kubernetes-src-readme",
outs = ["README-src.txt"],
cmd = """
echo For build efficiency, the src was not included in this release.>$@
echo The full source code can be viewed at >>$@
echo -n https://github.com/kubernetes/kubernetes/tree/ >>$@
grep ^STABLE_BUILD_GIT_COMMIT bazel-out/stable-status.txt | cut -d' ' -f2 >>$@
""",
stamp = 1,
)
pkg_tar(
name = "kubernetes-src",
extension = "tar.gz",
files = [
"//:all-srcs",
],
files = select({
":package_src": ["//:all-srcs"],
"//conditions:default": ["README-src.txt"],
}),
package_dir = "kubernetes",
strip_prefix = "//",
strip_prefix = select({
":package_src": "//",
"//conditions:default": ".",
}),
)
# FIXME: this should be configurable/auto-detected
@ -124,10 +140,7 @@ pkg_tar(
pkg_tar(
name = "kubernetes-node-%s" % PLATFORM_ARCH_STRING,
extension = "tar.gz",
files = select({
":embed_license_targets": LICENSE_TARGETS,
"//conditions:default": [],
}),
files = LICENSE_TARGETS,
mode = "0644",
package_dir = "kubernetes",
deps = [
@ -164,10 +177,7 @@ pkg_tar(
pkg_tar(
name = "kubernetes-server-%s" % PLATFORM_ARCH_STRING,
extension = "tar.gz",
files = select({
":embed_license_targets": LICENSE_TARGETS,
"//conditions:default": [],
}),
files = LICENSE_TARGETS,
mode = "0644",
package_dir = "kubernetes",
deps = [
@ -211,17 +221,15 @@ pkg_tar(
name = "kubernetes",
extension = "tar.gz",
files = [
"//:version",
"//:Godeps/LICENSES",
"//:README.md",
"//:Vagrantfile",
"//:version",
"//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 = [