| 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 = "go_default_library", |
| srcs = [ |
| "ingress.go", |
| "main.go", |
| "service.go", |
| ], |
| importpath = "code.hackerspace.pl/hscloud/cluster/admitomatic", |
| visibility = ["//visibility:private"], |
| deps = [ |
| "//cluster/admitomatic/config:go_default_library", |
| "//go/mirko:go_default_library", |
| "@com_github_golang_glog//:go_default_library", |
| "@io_k8s_api//admission/v1beta1:go_default_library", |
| "@io_k8s_api//networking/v1beta1:go_default_library", |
| "@io_k8s_apimachinery//pkg/apis/meta/v1:go_default_library", |
| "@org_golang_google_protobuf//encoding/prototext:go_default_library", |
| ], |
| ) |
| |
| go_binary( |
| name = "admitomatic", |
| embed = [":go_default_library"], |
| visibility = ["//visibility:public"], |
| ) |
| |
| go_test( |
| name = "go_default_test", |
| srcs = ["ingress_test.go"], |
| embed = [":go_default_library"], |
| deps = [ |
| "@io_k8s_api//admission/v1beta1:go_default_library", |
| "@io_k8s_api//networking/v1beta1:go_default_library", |
| "@io_k8s_apimachinery//pkg/apis/meta/v1:go_default_library", |
| "@io_k8s_apimachinery//pkg/runtime:go_default_library", |
| ], |
| ) |
| |
| container_layer( |
| name = "layer_bin", |
| files = [ |
| ":admitomatic", |
| ], |
| directory = "/cluster/admitomatic/", |
| ) |
| |
| container_image( |
| name = "runtime", |
| base = "@prodimage-bionic//image", |
| layers = [ |
| ":layer_bin", |
| ], |
| ) |
| |
| container_push( |
| name = "push", |
| image = ":runtime", |
| format = "Docker", |
| registry = "registry.k0.hswaw.net", |
| repository = "q3k/admitomatic", |
| tag = "{BUILD_TIMESTAMP}-{STABLE_GIT_COMMIT}", |
| ) |