load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") load("//hack/build/rules/container:index.bzl", "container_push", "go_oci_image") go_binary( name = "backend", data = [ ":envfile", ], embed = [":api_lib"], visibility = ["//visibility:public"], ) # create a filegroup to wrap the .env file, which may or may not exist # consumers that would use .env directly as a data dep can just reference this # target instead filegroup( name = "envfile", # buildifier: disable=constant-glob srcs = glob([".env"]), visibility = ["//visibility:public"], ) go_oci_image( name = "backend_container", embed = [":api_lib"], tags = ["manual"], ) container_push( name = "container_push", image = ":backend_container", image_name = "edge-backend", repository_file = "//hack/build/rules/container:workloads-repo", ) go_library( name = "api_lib", srcs = ["server.go"], importpath = "edge-infra.dev/cmd/edge/api", visibility = ["//visibility:private"], deps = [ "//pkg/edge/api/graph/setup", "//pkg/edge/api/types", "//pkg/lib/fog", "@com_github_gin_gonic_gin//:gin", "@com_github_googlecloudplatform_cloudsql_proxy//proxy/dialers/postgres", "@com_github_joho_godotenv//:godotenv", "@com_github_peterbourgon_ff_v3//:ff", ], )