ceph-csi/vendor/k8s.io/kubernetes/build/release-tars/BUILD

228 lines
5.0 KiB
Python
Raw Normal View History

2018-01-09 18:57:14 +00:00
package(default_visibility = ["//visibility:public"])
load("@io_kubernetes_build//defs:build.bzl", "release_filegroup")
2018-03-06 22:33:18 +00:00
load("@io_kubernetes_build//defs:pkg.bzl", "pkg_tar")
2018-01-09 18:57:14 +00:00
filegroup(
name = "package-srcs",
srcs = glob(["**"]),
tags = ["automanaged"],
visibility = ["//visibility:private"],
)
filegroup(
name = "all-srcs",
srcs = [":package-srcs"],
tags = ["automanaged"],
)
config_setting(
name = "package_src",
values = {
"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",
2018-03-06 22:33:18 +00:00
srcs = select({
2018-01-09 18:57:14 +00:00
":package_src": ["//:all-srcs"],
"//conditions:default": ["README-src.txt"],
}),
2018-03-06 22:33:18 +00:00
extension = "tar.gz",
2018-01-09 18:57:14 +00:00
package_dir = "kubernetes",
strip_prefix = select({
":package_src": "//",
"//conditions:default": ".",
}),
2018-03-06 22:33:18 +00:00
tags = ["no-cache"],
2018-01-09 18:57:14 +00:00
)
# FIXME: this should be configurable/auto-detected
PLATFORM_ARCH_STRING = "linux-amd64"
# Included in node and server tarballs.
filegroup(
name = "license-targets",
srcs = [
":kubernetes-src.tar.gz",
"//:Godeps/LICENSES",
],
visibility = ["//visibility:private"],
)
pkg_tar(
name = "_client-bin",
2018-03-06 22:33:18 +00:00
srcs = ["//build:client-targets"],
2018-01-09 18:57:14 +00:00
mode = "0755",
package_dir = "client/bin",
2018-03-06 22:33:18 +00:00
tags = ["no-cache"],
2018-01-09 18:57:14 +00:00
visibility = ["//visibility:private"],
)
pkg_tar(
name = "kubernetes-client-%s" % PLATFORM_ARCH_STRING,
extension = "tar.gz",
package_dir = "kubernetes",
2018-03-06 22:33:18 +00:00
tags = ["no-cache"],
2018-01-09 18:57:14 +00:00
deps = [
":_client-bin",
],
)
pkg_tar(
name = "_node-bin",
2018-03-06 22:33:18 +00:00
srcs = [
2018-01-09 18:57:14 +00:00
"//build:client-targets",
"//build:node-targets",
],
mode = "0755",
package_dir = "node/bin",
2018-03-06 22:33:18 +00:00
tags = ["no-cache"],
2018-01-09 18:57:14 +00:00
visibility = ["//visibility:private"],
)
pkg_tar(
name = "kubernetes-node-%s" % PLATFORM_ARCH_STRING,
2018-03-06 22:33:18 +00:00
srcs = [":license-targets"],
2018-01-09 18:57:14 +00:00
extension = "tar.gz",
mode = "0644",
package_dir = "kubernetes",
2018-03-06 22:33:18 +00:00
tags = ["no-cache"],
2018-01-09 18:57:14 +00:00
deps = [
":_node-bin",
],
)
pkg_tar(
name = "_server-bin",
2018-03-06 22:33:18 +00:00
srcs = [
2018-01-09 18:57:14 +00:00
"//build:client-targets",
"//build:docker-artifacts",
"//build:node-targets",
"//build:server-targets",
],
mode = "0755",
package_dir = "server/bin",
2018-03-06 22:33:18 +00:00
tags = ["no-cache"],
2018-01-09 18:57:14 +00:00
visibility = ["//visibility:private"],
)
genrule(
name = "dummy",
outs = [".dummy"],
cmd = "touch $@",
visibility = ["//visibility:private"],
)
# Some of the startup scripts fail if there isn't an addons/ directory in the server tarball.
pkg_tar(
name = "_server-addons",
2018-03-06 22:33:18 +00:00
srcs = [
2018-01-09 18:57:14 +00:00
":.dummy",
],
package_dir = "addons",
2018-03-06 22:33:18 +00:00
tags = ["no-cache"],
2018-01-09 18:57:14 +00:00
visibility = ["//visibility:private"],
)
pkg_tar(
name = "kubernetes-server-%s" % PLATFORM_ARCH_STRING,
2018-03-06 22:33:18 +00:00
srcs = [":license-targets"],
2018-01-09 18:57:14 +00:00
extension = "tar.gz",
mode = "0644",
package_dir = "kubernetes",
2018-03-06 22:33:18 +00:00
tags = ["no-cache"],
2018-01-09 18:57:14 +00:00
deps = [
":_server-addons",
":_server-bin",
],
)
pkg_tar(
name = "_test-bin",
2018-03-06 22:33:18 +00:00
srcs = ["//build:test-targets"],
2018-01-09 18:57:14 +00:00
mode = "0755",
package_dir = "platforms/" + PLATFORM_ARCH_STRING.replace("-", "/"),
2018-03-06 22:33:18 +00:00
tags = ["no-cache"],
2018-01-09 18:57:14 +00:00
# TODO: how to make this multiplatform?
visibility = ["//visibility:private"],
)
pkg_tar(
name = "kubernetes-test",
2018-03-06 22:33:18 +00:00
srcs = ["//build:test-portable-targets"],
2018-01-09 18:57:14 +00:00
extension = "tar.gz",
package_dir = "kubernetes",
strip_prefix = "//",
2018-03-06 22:33:18 +00:00
tags = ["no-cache"],
2018-01-09 18:57:14 +00:00
deps = [
# TODO: how to make this multiplatform?
":_test-bin",
],
)
pkg_tar(
name = "_full_server",
2018-03-06 22:33:18 +00:00
srcs = [
2018-01-09 18:57:14 +00:00
":kubernetes-manifests.tar.gz",
],
package_dir = "server",
2018-03-06 22:33:18 +00:00
tags = ["no-cache"],
2018-01-09 18:57:14 +00:00
visibility = ["//visibility:private"],
)
pkg_tar(
name = "kubernetes",
2018-03-06 22:33:18 +00:00
srcs = [
2018-01-09 18:57:14 +00:00
"//:Godeps/LICENSES",
"//:README.md",
"//:version",
"//cluster:all-srcs",
"//docs:all-srcs",
"//hack/lib:all-srcs",
],
2018-03-06 22:33:18 +00:00
extension = "tar.gz",
2018-01-09 18:57:14 +00:00
package_dir = "kubernetes",
strip_prefix = "//",
2018-03-06 22:33:18 +00:00
tags = ["no-cache"],
2018-01-09 18:57:14 +00:00
deps = [
":_full_server",
],
)
pkg_tar(
name = "kubernetes-manifests",
extension = "tar.gz",
2018-03-06 22:33:18 +00:00
tags = ["no-cache"],
2018-01-09 18:57:14 +00:00
deps = [
"//cluster:manifests",
],
)
release_filegroup(
name = "release-tars",
srcs = [
":kubernetes.tar.gz",
":kubernetes-client-%s.tar.gz" % PLATFORM_ARCH_STRING,
":kubernetes-node-%s.tar.gz" % PLATFORM_ARCH_STRING,
":kubernetes-server-%s.tar.gz" % PLATFORM_ARCH_STRING,
":kubernetes-manifests.tar.gz",
":kubernetes-src.tar.gz",
":kubernetes-test.tar.gz",
],
)