Skip to content

Commit

Permalink
bazel: send the component name to prow_image
Browse files Browse the repository at this point in the history
Signed-off-by: Steve Kuznetsov <[email protected]>
  • Loading branch information
stevekuznetsov committed Mar 13, 2020
1 parent 2e907ac commit 0d4dcac
Show file tree
Hide file tree
Showing 51 changed files with 217 additions and 53 deletions.
5 changes: 4 additions & 1 deletion boskos/aws-janitor/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,18 @@ go_library(
],
)

NAME = "aws-janitor"

go_binary(
name = "aws-janitor",
name = NAME,
embed = [":go_default_library"],
visibility = ["//visibility:public"],
)

prow_image(
name = "image",
base = "@gcloud-go//image",
component = NAME,
visibility = ["//visibility:public"],
)

Expand Down
5 changes: 4 additions & 1 deletion boskos/aws-janitor/cmd/aws-janitor-boskos/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,18 @@ load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
load("@io_bazel_rules_docker//go:image.bzl", "go_image")
load("//prow:def.bzl", "prow_image")

NAME = "aws-janitor-boskos"

go_binary(
name = "aws-janitor-boskos",
name = NAME,
embed = [":go_default_library"],
visibility = ["//visibility:public"],
)

prow_image(
name = "image",
base = "@gcloud-go//image",
component = NAME,
visibility = ["//visibility:public"],
)

Expand Down
5 changes: 4 additions & 1 deletion boskos/cmd/boskos/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
load("//prow:def.bzl", "prow_image")

NAME = "boskos"

go_binary(
name = "boskos",
name = NAME,
embed = [":go_default_library"],
pure = "on",
visibility = ["//visibility:public"],
)

prow_image(
name = "image",
component = NAME,
visibility = ["//visibility:public"],
)

Expand Down
2 changes: 1 addition & 1 deletion boskos/cmd/boskos/boskos.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func init() {
}

func main() {
logrusutil.ComponentInit("boskos")
logrusutil.ComponentInit()
kubeClientOptions.AddFlags(flag.CommandLine)
flag.Parse()
level, err := logrus.ParseLevel(*logLevel)
Expand Down
5 changes: 4 additions & 1 deletion boskos/cmd/cleaner/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,16 @@ go_library(
],
)

NAME = "cleaner"

prow_image(
name = "image",
component = NAME,
visibility = ["//visibility:public"],
)

go_binary(
name = "cleaner",
name = NAME,
embed = [":go_default_library"],
visibility = ["//visibility:public"],
)
Expand Down
2 changes: 1 addition & 1 deletion boskos/cmd/cleaner/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func init() {
}

func main() {
logrusutil.ComponentInit("boskos-cleaner")
logrusutil.ComponentInit()
flag.Parse()
kubeClientOptions.Validate()

Expand Down
5 changes: 4 additions & 1 deletion boskos/cmd/cli/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,17 @@ go_library(
],
)

NAME = "boskosctl"

prow_image(
name = "image",
base = "@boskosctl-base//image",
component = NAME,
visibility = ["//visibility:public"],
)

go_binary(
name = "boskosctl",
name = NAME,
embed = [":go_default_library"],
visibility = ["//visibility:public"],
)
Expand Down
5 changes: 4 additions & 1 deletion boskos/cmd/fake-mason/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,16 @@ go_library(
],
)

NAME = "fake-mason"

prow_image(
name = "image",
component = NAME,
visibility = ["//visibility:public"],
)

go_binary(
name = "fake-mason",
name = NAME,
embed = [":go_default_library"],
visibility = ["//visibility:public"],
)
Expand Down
5 changes: 4 additions & 1 deletion boskos/cmd/janitor/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ load(
"go_test",
)

NAME = "janitor"

go_binary(
name = "janitor",
name = NAME,
embed = [":go_default_library"],
pure = "on",
)
Expand Down Expand Up @@ -49,6 +51,7 @@ container_image(
prow_image(
name = "image",
base = ":janitor_image",
component = NAME,
# the entrypoint must be sh
# https://github.com/kubernetes/test-infra/issues/5877
entrypoint = [
Expand Down
5 changes: 4 additions & 1 deletion boskos/cmd/metrics/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ load(
"go_library",
)

NAME = "metrics"

go_binary(
name = "metrics",
name = NAME,
embed = [":go_default_library"],
pure = "on",
)
Expand All @@ -34,6 +36,7 @@ go_library(

prow_image(
name = "image",
component = NAME,
visibility = ["//visibility:public"],
)

Expand Down
5 changes: 4 additions & 1 deletion boskos/cmd/reaper/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ package(default_visibility = ["//visibility:public"])
load("//prow:def.bzl", "prow_image")
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")

NAME = "reaper"

go_binary(
name = "reaper",
name = NAME,
embed = [":go_default_library"],
pure = "on",
)
Expand All @@ -22,6 +24,7 @@ go_library(

prow_image(
name = "image",
component = NAME,
visibility = ["//visibility:public"],
)

Expand Down
9 changes: 7 additions & 2 deletions experiment/resultstore/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test")
load("//prow:def.bzl", "prow_image", "prow_push")

prow_image(name = "image")
NAME = "resultstore"

prow_image(
name = "image",
component = NAME,
)

prow_push(
name = "push",
Expand Down Expand Up @@ -37,7 +42,7 @@ go_library(
)

go_binary(
name = "resultstore",
name = NAME,
embed = [":go_default_library"],
visibility = ["//visibility:public"],
)
Expand Down
5 changes: 4 additions & 1 deletion ghproxy/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ package(default_visibility = ["//visibility:public"])
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
load("//prow:def.bzl", "prow_image", "prow_push")

NAME = "ghproxy"

go_binary(
name = "ghproxy",
name = NAME,
embed = [":go_default_library"],
visibility = ["//visibility:public"],
)
Expand All @@ -21,6 +23,7 @@ prow_push(
prow_image(
name = "image",
base = "@alpine-base//image",
component = NAME,
visibility = ["//visibility:public"],
)

Expand Down
5 changes: 4 additions & 1 deletion greenhouse/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ go_library(
],
)

NAME = "greenhouse"

go_binary(
name = "greenhouse",
name = NAME,
embed = [":go_default_library"],
pure = "on",
visibility = ["//visibility:public"],
Expand All @@ -49,6 +51,7 @@ filegroup(
prow_image(
name = "image",
base = "@alpine-base//image",
component = NAME,
visibility = ["//visibility:public"],
)

Expand Down
5 changes: 4 additions & 1 deletion label_sync/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,12 @@ package(default_visibility = ["//visibility:public"])

licenses(["notice"])

NAME = "label_sync"

prow_image(
name = "image",
base = "@alpine-base//image",
component = NAME,
visibility = ["//visibility:public"],
)

Expand All @@ -28,7 +31,7 @@ prow_push(
)

go_binary(
name = "label_sync",
name = NAME,
embed = [":go_default_library"],
)

Expand Down
5 changes: 4 additions & 1 deletion prow/cmd/admission/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test")
load("//prow:def.bzl", "prow_image")

NAME = "admission"

prow_image(
name = "image",
component = NAME,
visibility = ["//visibility:public"],
)

Expand Down Expand Up @@ -31,7 +34,7 @@ go_library(
)

go_binary(
name = "admission",
name = NAME,
embed = [":go_default_library"],
visibility = ["//visibility:public"],
)
Expand Down
5 changes: 4 additions & 1 deletion prow/cmd/branchprotector/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,12 @@ k8s_object(
template = ":oneshot-job.yaml",
)

NAME = "branchprotector"

prow_image(
name = "image",
base = "@alpine-base//image",
component = NAME,
directory = "/",
files = [":branchprotector"],
visibility = ["//visibility:public"],
Expand Down Expand Up @@ -72,7 +75,7 @@ filegroup(
)

go_binary(
name = "branchprotector",
name = NAME,
embed = [":go_default_library"],
pure = "on",
visibility = ["//visibility:public"],
Expand Down
5 changes: 4 additions & 1 deletion prow/cmd/checkconfig/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,19 @@ filegroup(
visibility = ["//visibility:public"],
)

NAME = "checkconfig"

prow_image(
name = "image",
base = "@git-base//image",
component = NAME,
directory = "/",
files = [":checkconfig"],
visibility = ["//visibility:public"],
)

go_binary(
name = "checkconfig",
name = NAME,
embed = [":go_default_library"],
pure = "on",
visibility = ["//visibility:public"],
Expand Down
5 changes: 4 additions & 1 deletion prow/cmd/clonerefs/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ go_library(
],
)

NAME = "clonerefs"

go_binary(
name = "clonerefs",
name = NAME,
embed = [":go_default_library"],
pure = "on",
visibility = ["//visibility:public"],
Expand All @@ -24,6 +26,7 @@ go_binary(
prow_image(
name = "image",
base = "@git-base//image",
component = NAME,
files = [
"github_known_hosts",
"ssh_config",
Expand Down
5 changes: 4 additions & 1 deletion prow/cmd/config-bootstrapper/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,17 @@ filegroup(
tags = ["automanaged"],
)

NAME = "config-bootstrapper"

go_binary(
name = "config-bootstrapper",
name = NAME,
embed = [":go_default_library"],
)

prow_image(
name = "image",
base = "@git-base//image",
component = NAME,
directory = "/",
files = [":config-bootstrapper"],
visibility = ["//visibility:public"],
Expand Down
Loading

0 comments on commit 0d4dcac

Please sign in to comment.