cert-manager/hack/BUILD.bazel
JoshVanL fae39bb525 Adds CLI migration tool with docs on how to use it
Signed-off-by: JoshVanL <vleeuwenjoshua@gmail.com>
2019-10-08 16:09:57 +01:00

308 lines
6.8 KiB
Python

package(default_visibility = ["//visibility:public"])
# General repo verification targets
py_test(
name = "verify-boilerplate",
srcs = ["verify_boilerplate.py"],
data = ["@//:all-srcs"],
main = "verify_boilerplate.py",
python_version = "PY3",
tags = ["lint"],
)
sh_test(
name = "verify-errexit",
srcs = ["verify-errexit.sh"],
data = [
"@//:all-srcs",
],
tags = ["lint"],
)
sh_test(
name = "verify-links",
srcs = ["verify-links.sh"],
data = [
"@//:all-srcs",
],
tags = ["lint"],
)
GAZELLE = "@bazel_gazelle//cmd/gazelle"
KAZEL = "@io_k8s_repo_infra//cmd/kazel"
GO = "@go_sdk//:bin/go"
GOROOT = "@go_sdk//:files"
JQ = "@com_github_jetstack_cert_manager//hack/bin:jq"
# Bazel file generation rules
sh_binary(
name = "update-bazel",
srcs = ["update-bazel.sh"],
args = [
"$(location %s)" % GAZELLE,
"$(location %s)" % KAZEL,
],
data = [
GAZELLE,
KAZEL,
],
)
sh_test(
name = "verify-bazel",
srcs = ["verify-bazel.sh"],
args = [
"$(location %s)" % GAZELLE,
"$(location %s)" % KAZEL,
],
data = [
"@//:all-srcs",
GAZELLE,
KAZEL,
],
tags = ["lint"],
)
sh_binary(
name = "update-deps",
srcs = ["update-deps.sh"],
args = [
"$(location %s)" % GO,
"$(location %s)" % GAZELLE,
"$(location %s)" % KAZEL,
"$(location %s)" % JQ,
"$(location :update-bazel)",
"$(location :update-deps-licenses)",
],
data = [
GAZELLE,
GO,
KAZEL,
JQ,
":update-bazel",
":update-deps-licenses",
],
)
sh_test(
name = "verify-deps",
srcs = ["verify-deps.sh"],
args = [
"$(location :update-deps)",
"$(location %s)" % GO,
"$(location %s)" % GAZELLE,
"$(location %s)" % KAZEL,
"$(location %s)" % JQ,
"$(location :update-bazel)",
"$(location :update-deps-licenses)",
],
data = [
":update-deps",
GAZELLE,
GO,
KAZEL,
JQ,
":update-bazel",
":update-deps-licenses",
"@//:all-srcs",
],
tags = ["manual"],
)
sh_binary(
name = "update-deps-licenses",
srcs = ["update-deps-licenses.sh"],
args = [
"$(location %s)" % GO,
"$(location %s)" % JQ,
],
data = [
GO,
JQ,
],
)
sh_test(
name = "verify-deps-licenses",
srcs = ["verify-deps-licenses.sh"],
args = [
"$(location :update-deps-licenses)",
"$(location %s)" % GO,
"$(location %s)" % JQ,
],
data = [
GAZELLE,
GO,
KAZEL,
JQ,
":update-deps-licenses",
"@//:all-srcs",
],
tags = ["manual"],
)
# Kubernetes codegen rules
sh_binary(
name = "update-codegen",
srcs = ["update-codegen.sh"],
args = [
"$(location %s)" % GO,
"$(location @io_k8s_code_generator//cmd/client-gen)",
"$(location @io_k8s_code_generator//cmd/deepcopy-gen)",
"$(location @io_k8s_code_generator//cmd/informer-gen)",
"$(location @io_k8s_code_generator//cmd/lister-gen)",
"$(location @io_k8s_code_generator//cmd/defaulter-gen)",
"$(location @io_k8s_code_generator//cmd/conversion-gen)",
"$(location :update-bazel)",
"$(location %s)" % GAZELLE,
"$(location %s)" % KAZEL,
],
data = [
":update-bazel",
GO,
GOROOT,
GAZELLE,
KAZEL,
"@io_k8s_code_generator//cmd/client-gen",
"@io_k8s_code_generator//cmd/conversion-gen",
"@io_k8s_code_generator//cmd/deepcopy-gen",
"@io_k8s_code_generator//cmd/defaulter-gen",
"@io_k8s_code_generator//cmd/informer-gen",
"@io_k8s_code_generator//cmd/lister-gen",
],
)
sh_test(
name = "verify-codegen",
srcs = ["verify-codegen.sh"],
args = [
"$(location :update-codegen)",
"$(location %s)" % GO,
"$(location @io_k8s_code_generator//cmd/client-gen)",
"$(location @io_k8s_code_generator//cmd/deepcopy-gen)",
"$(location @io_k8s_code_generator//cmd/informer-gen)",
"$(location @io_k8s_code_generator//cmd/lister-gen)",
"$(location @io_k8s_code_generator//cmd/defaulter-gen)",
"$(location @io_k8s_code_generator//cmd/conversion-gen)",
"$(location :update-bazel)",
"$(location %s)" % GAZELLE,
"$(location %s)" % KAZEL,
],
data = [
":update-bazel",
":update-codegen",
GO,
GOROOT,
GAZELLE,
KAZEL,
"@//:all-srcs",
"@io_k8s_code_generator//cmd/client-gen",
"@io_k8s_code_generator//cmd/conversion-gen",
"@io_k8s_code_generator//cmd/deepcopy-gen",
"@io_k8s_code_generator//cmd/defaulter-gen",
"@io_k8s_code_generator//cmd/informer-gen",
"@io_k8s_code_generator//cmd/lister-gen",
],
)
# Reference docs generation rules
sh_binary(
name = "update-reference-docs",
srcs = ["update-reference-docs.sh"],
args = [
"$(location @//docs/generated/reference/generate)",
],
data = [
"@//docs/generated/reference/generate",
],
)
sh_test(
name = "verify-reference-docs",
srcs = ["verify-reference-docs.sh"],
args = [
"$(location :update-reference-docs)",
"$(location @//docs/generated/reference/generate)",
],
data = [
":update-reference-docs",
"@//docs/generated/reference:output",
"@//docs/generated/reference/generate",
],
)
# Gofmt rules
GOFMT = "@go_sdk//:bin/gofmt"
sh_binary(
name = "update-gofmt",
srcs = ["update-gofmt.sh"],
args = [
"$(location %s)" % GOFMT,
],
data = [
GOFMT,
],
)
sh_test(
name = "verify-gofmt",
srcs = ["verify-gofmt.sh"],
args = [
"$(location %s)" % GOFMT,
],
data = [
GOFMT,
"@//:all-srcs",
],
)
sh_binary(
name = "update-crds",
srcs = ["update-crds.sh"],
args = [
"$(location @//deploy/manifests:crds.yaml.generated)",
],
data = [
"@//deploy/manifests:crds.yaml.generated",
],
)
sh_test(
name = "verify-crds",
srcs = ["verify-crds.sh"],
data = [
"@//deploy/manifests:00-crds.yaml",
"@//deploy/manifests:crds.yaml.generated",
],
)
filegroup(
name = "package-srcs",
srcs = glob(["**"]),
tags = ["automanaged"],
visibility = ["//visibility:private"],
)
filegroup(
name = "all-srcs",
srcs = [
":package-srcs",
"//hack/api-migration:all-srcs",
"//hack/bin:all-srcs",
"//hack/boilerplate:all-srcs",
"//hack/build:all-srcs",
"//hack/release:all-srcs",
],
tags = ["automanaged"],
visibility = ["//visibility:public"],
)