| 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}", |
| ) |