...
1load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
2load("//hack/build/rules/container:index.bzl", "container_push", "go_oci_image")
3
4go_library(
5 name = "bsl_lib",
6 srcs = ["main.go"],
7 importpath = "edge-infra.dev/cmd/edge/bsl",
8 visibility = ["//visibility:private"],
9 deps = [
10 "//pkg/edge/bsl-reconciler",
11 "@com_github_joho_godotenv//:godotenv",
12 ],
13)
14
15# create a filegroup to wrap the .env file, which may or may not exist
16# consumers that would use .env directly as a data dep can just reference this
17# target instead
18filegroup(
19 name = "envfile",
20 # buildifier: disable=constant-glob
21 srcs = glob([".env"]),
22 visibility = ["//visibility:public"],
23)
24
25go_binary(
26 name = "bsl",
27 data = [
28 ":envfile",
29 ],
30 embed = [":bsl_lib"],
31 visibility = ["//visibility:public"],
32)
33
34go_oci_image(
35 name = "bsl_container",
36 embed = [":bsl_lib"],
37 tags = ["manual"],
38)
39
40container_push(
41 name = "container_push",
42 image = ":bsl_container",
43 image_name = "edge-bsl",
44 repository_file = "//hack/build/rules/container:workloads-repo",
45)
View as plain text