k3s/build/root/BUILD.root

109 lines
3.2 KiB
Plaintext
Raw Normal View History

2018-08-27 21:00:42 +00:00
# gazelle:build_file_name BUILD,BUILD.bazel
# gazelle:exclude _artifacts
# gazelle:exclude _gopath
# gazelle:exclude _output
# gazelle:exclude _tmp
2018-08-27 21:00:42 +00:00
# gazelle:prefix k8s.io/kubernetes
2018-05-03 22:37:33 +00:00
# Disable proto rules, since the Go sources are currently generated by
# hack/update-generated-protobuf.sh and checked into the repo.
2018-08-27 21:00:42 +00:00
# gazelle:proto disable_global
2018-05-03 22:37:33 +00:00
package(default_visibility = ["//visibility:public"])
load("@io_k8s_repo_infra//defs:build.bzl", "gcs_upload")
load("//build:platforms.bzl", "for_platforms")
filegroup(
name = "_binary-artifacts-and-hashes",
srcs = select(for_platforms(
for_client = ["//build:client-targets-and-hashes"],
for_node = [
"//build:node-targets-and-hashes",
"//build/debs:debs-and-hashes",
],
for_server = [
"//build:docker-artifacts-and-hashes",
"//build:server-targets-and-hashes",
],
)),
visibility = ["//visibility:private"],
)
2019-03-06 20:33:42 +00:00
# TODO: collect all relevant docker_push targets into one target that can be run:
# //build:push-server-images
# //cluster/images/conformance:push-conformance
# //cluster/images/hyperkube:push-hyperkube
gcs_upload(
name = "push-build",
data = [
":_binary-artifacts-and-hashes",
"//build/release-tars:release-tars-and-hashes",
2018-04-12 18:14:22 +00:00
"//cluster/gce/gci:gcs-release-artifacts-and-hashes",
"//cluster/gce/windows:gcs-release-artifacts-and-hashes",
],
2017-09-21 21:52:54 +00:00
tags = ["manual"],
2019-02-14 00:42:38 +00:00
# Use for_platforms to format the upload path based on the configured
# platform (os/arch).
# For example, this will turn into something like
# upload_paths = select({
# "@io_bazel_rules_go//go/platform:windows_386": {
# ...,"//:binary-artifacts-and-hashes": "bin/windows/386"},
# "@io_bazel_rules_go//go/platform:linux_ppc64le": {
# ...,"//:binary-artifacts-and-hashes": "bin/linux/ppc64le"},
#})
# and bazel will select the correct entry.
upload_paths = select(for_platforms(for_all = {
"//build/release-tars:release-tars-and-hashes": "",
2018-04-12 18:14:22 +00:00
"//cluster/gce/gci:gcs-release-artifacts-and-hashes": "extra/gce",
"//cluster/gce/windows:gcs-release-artifacts-and-hashes": "extra/gce/windows",
"//:_binary-artifacts-and-hashes": "bin/{OS}/{ARCH}",
})),
)
filegroup(
name = "package-srcs",
srcs = glob(
["**"],
exclude = [
"bazel-*/**",
"_*/**",
".config/**",
".git/**",
".gsutil/**",
".make/**",
],
),
visibility = ["//visibility:private"],
)
filegroup(
name = "all-srcs",
srcs = [
":package-srcs",
2017-12-23 00:49:04 +00:00
"//api/openapi-spec:all-srcs",
"//build:all-srcs",
"//cluster:all-srcs",
"//cmd:all-srcs",
"//docs:all-srcs",
"//hack:all-srcs",
"//pkg:all-srcs",
"//plugin:all-srcs",
"//staging:all-srcs",
"//test:all-srcs",
"//third_party:all-srcs",
"//translations:all-srcs",
2017-08-24 21:07:21 +00:00
"//vendor:all-srcs",
],
tags = ["automanaged"],
)
genrule(
name = "save_git_version",
outs = ["version"],
cmd = "grep ^STABLE_BUILD_SCM_REVISION bazel-out/stable-status.txt | awk '{print $$2}' >$@",
stamp = 1,
)