diff --git a/Makefile b/Makefile index cec17670bc3..79ae87c9f02 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/build/release-tars/BUILD b/build/release-tars/BUILD index 67cc91af10a..a8df00cb712 100644 --- a/build/release-tars/BUILD +++ b/build/release-tars/BUILD @@ -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 = [