hscloud/cluster/admitomatic/BUILD.bazel
Serge Bazanski 633fb2e8ce cluster/admitomatic: deploy
Change-Id: Id08c4b428a9c01b310b69396890083f999090928
Reviewed-on: https://gerrit.hackerspace.pl/c/hscloud/+/1749
Reviewed-by: radex <radex@hackerspace.pl>
2023-10-28 20:12:30 +00:00

67 lines
1.6 KiB
Python

load("@io_bazel_rules_docker//container:container.bzl", "container_image", "container_layer", "container_push")
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test")
go_library(
name = "admitomatic_lib",
srcs = [
"ingress.go",
"main.go",
"service.go",
],
importpath = "code.hackerspace.pl/hscloud/cluster/admitomatic",
visibility = ["//visibility:private"],
deps = [
"//cluster/admitomatic/config",
"//go/mirko",
"@com_github_golang_glog//:glog",
"@io_k8s_api//admission/v1beta1",
"@io_k8s_api//networking/v1beta1",
"@io_k8s_apimachinery//pkg/apis/meta/v1:meta",
"@org_golang_google_protobuf//encoding/prototext",
],
)
go_binary(
name = "admitomatic",
embed = [":admitomatic_lib"],
pure = "on",
static = "on",
visibility = ["//visibility:public"],
)
go_test(
name = "admitomatic_test",
srcs = ["ingress_test.go"],
embed = [":admitomatic_lib"],
deps = [
"@io_k8s_api//admission/v1beta1",
"@io_k8s_api//networking/v1beta1",
"@io_k8s_apimachinery//pkg/apis/meta/v1:meta",
"@io_k8s_apimachinery//pkg/runtime",
],
)
container_layer(
name = "layer_bin",
directory = "/cluster/admitomatic/",
files = [
":admitomatic",
],
)
container_image(
name = "runtime",
base = "@prodimage-bionic//image",
layers = [
":layer_bin",
],
)
container_push(
name = "push",
format = "Docker",
image = ":runtime",
registry = "registry.k0.hswaw.net",
repository = "cluster/admitomatic",
tag = "1698514671-{STABLE_GIT_COMMIT}",
)