forked from kubernetes/org
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BUILD.bazel
48 lines (44 loc) · 1.25 KB
/
BUILD.bazel
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
load("@io_bazel_rules_go//go:def.bzl", "go_test")
genrule(
name = "gen-config.yaml",
srcs = glob(["**/*.yaml"]),
outs = ["config.yaml"],
cmd = """
parts=()
for val in $(SRCS); do
if [[ "$$val" == *"/org.yaml" ]]; then
key="$$(basename "$$(dirname "$$val")")"
parts+=(--org-part=$$key=$$val)
fi
done
./$(location //cmd/merge) --merge-teams $${parts[@]} > $(location config.yaml)""",
tools = ["//cmd/merge"],
visibility = ["//visibility:public"],
)
go_test(
name = "go_default_test",
srcs = ["config_test.go"],
data = glob([
"*/org.yaml",
"*/OWNERS",
]) + ["config.yaml"],
deps = [
"//vendor/github.com/ghodss/yaml:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/util/sets:go_default_library",
"//vendor/k8s.io/test-infra/prow/config:go_default_library",
"//vendor/k8s.io/test-infra/prow/config/org:go_default_library",
"//vendor/k8s.io/test-infra/prow/github:go_default_library",
],
)
filegroup(
name = "package-srcs",
srcs = glob(["**"]),
tags = ["automanaged"],
visibility = ["//visibility:private"],
)
filegroup(
name = "all-srcs",
srcs = [":package-srcs"],
tags = ["automanaged"],
visibility = ["//visibility:public"],
)