load("@io_bazel_rules_docker//container:container.bzl", "container_bundle")
load("@io_bazel_rules_docker//contrib:push-all.bzl", "docker_push")

# export WORKSPACE so workspace_binary rules can be used outside the root
exports_files(["WORKSPACE"])

# gazelle:proto disable_global

container_bundle(
    name = "images",
    images = {
        "{STABLE_DOCKER_REPO}/cert-manager-controller:{STABLE_DOCKER_TAG}": "//cmd/controller:image",
        "{STABLE_DOCKER_REPO}/cert-manager-acmesolver:{STABLE_DOCKER_TAG}": "//cmd/acmesolver:image",
        "{STABLE_DOCKER_REPO}/cert-manager-webhook:{STABLE_DOCKER_TAG}": "//cmd/webhook:image",
        "{STABLE_DOCKER_REPO}/cert-manager-cainjector:{STABLE_DOCKER_TAG}": "//cmd/cainjector:image",
    },
)

docker_push(
    name = "images.push",
    bundle = ":images",
)

filegroup(
    name = "package-srcs",
    srcs = glob(
        ["**"],
        exclude = [
            "bazel-*/**",
            ".git/**",
        ],
    ),
    visibility = ["//visibility:private"],
)

filegroup(
    name = "all-srcs",
    srcs = [
        ":package-srcs",
        "//cmd/acmesolver:all-srcs",
        "//cmd/cainjector:all-srcs",
        "//cmd/controller:all-srcs",
        "//cmd/webhook:all-srcs",
        "//deploy:all-srcs",
        "//docs/generated/reference:all-srcs",
        "//hack:all-srcs",
        "//pkg/acme:all-srcs",
        "//pkg/api:all-srcs",
        "//pkg/apis:all-srcs",
        "//pkg/client/clientset/versioned:all-srcs",
        "//pkg/client/informers/externalversions:all-srcs",
        "//pkg/client/listers/certmanager/v1alpha1:all-srcs",
        "//pkg/controller:all-srcs",
        "//pkg/feature:all-srcs",
        "//pkg/internal:all-srcs",
        "//pkg/issuer:all-srcs",
        "//pkg/logs:all-srcs",
        "//pkg/metrics:all-srcs",
        "//pkg/scheduler:all-srcs",
        "//pkg/util:all-srcs",
        "//pkg/webhook:all-srcs",
        "//test/acme/dns:all-srcs",
        "//test/e2e:all-srcs",
        "//test/unit/gen:all-srcs",
        "//test/unit/listers:all-srcs",
        "//test/util:all-srcs",
        "//third_party:all-srcs",
        "//vendor:all-srcs",
    ],
    tags = ["automanaged"],
    visibility = ["//visibility:public"],
)
