github.com/abayer/test-infra@v0.0.5/robots/commenter/BUILD.bazel (about)

     1  package(default_visibility = ["//visibility:public"])
     2  
     3  load("@io_bazel_rules_docker//docker:docker.bzl", "docker_bundle")
     4  load("@io_bazel_rules_docker//contrib:push-all.bzl", "docker_push")
     5  load("@io_bazel_rules_docker//go:image.bzl", "go_image")
     6  
     7  docker_bundle(
     8      name = "bundle",
     9      images = {
    10          "{STABLE_DOCKER_REPO}/commenter:{DOCKER_TAG}": ":commenter-image",
    11          "{STABLE_DOCKER_REPO}/commenter:latest": ":commenter-image",
    12          "{STABLE_DOCKER_REPO}/commenter:latest-{BUILD_USER}": ":commenter-image",
    13      },
    14      stamp = True,
    15  )
    16  
    17  docker_push(
    18      name = "push",
    19      bundle = ":bundle",
    20  )
    21  
    22  load(
    23      "@io_bazel_rules_go//go:def.bzl",
    24      "go_binary",
    25      "go_library",
    26      "go_test",
    27  )
    28  
    29  go_image(
    30      name = "commenter-image",
    31      base = "@distroless-base//image",
    32      embed = [":go_default_library"],
    33  )
    34  
    35  go_library(
    36      name = "go_default_library",
    37      srcs = ["main.go"],
    38      importpath = "k8s.io/test-infra/robots/commenter",
    39      deps = [
    40          "//prow/config:go_default_library",
    41          "//prow/flagutil:go_default_library",
    42          "//prow/github:go_default_library",
    43      ],
    44  )
    45  
    46  filegroup(
    47      name = "package-srcs",
    48      srcs = glob(["**"]),
    49      tags = ["automanaged"],
    50      visibility = ["//visibility:private"],
    51  )
    52  
    53  filegroup(
    54      name = "all-srcs",
    55      srcs = [":package-srcs"],
    56      tags = ["automanaged"],
    57  )
    58  
    59  go_test(
    60      name = "go_default_test",
    61      srcs = ["main_test.go"],
    62      embed = [":go_default_library"],
    63      deps = ["//prow/github:go_default_library"],
    64  )
    65  
    66  # Delete after gazelle stops forcing its creation
    67  go_binary(
    68      name = "commenter",
    69      embed = [":go_default_library"],
    70  )