Serge Bazanski | 044386d | 2021-05-24 15:10:08 +0200 | [diff] [blame] | 1 | load("@io_bazel_rules_docker//container:container.bzl", "container_image", "container_layer", "container_push") |
| 2 | load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") |
| 3 | |
| 4 | go_library( |
Serge Bazanski | 97b5cd7 | 2023-07-28 17:14:50 +0000 | [diff] [blame^] | 5 | name = "identd_lib", |
Serge Bazanski | 044386d | 2021-05-24 15:10:08 +0200 | [diff] [blame] | 6 | srcs = ["main.go"], |
| 7 | importpath = "code.hackerspace.pl/hscloud/cluster/identd", |
| 8 | visibility = ["//visibility:private"], |
| 9 | deps = [ |
Serge Bazanski | 97b5cd7 | 2023-07-28 17:14:50 +0000 | [diff] [blame^] | 10 | "//cluster/identd/ident", |
| 11 | "//cluster/identd/kubenat", |
| 12 | "//go/mirko", |
| 13 | "@com_github_golang_glog//:glog", |
| 14 | "@io_k8s_apimachinery//pkg/apis/meta/v1:meta", |
Serge Bazanski | 044386d | 2021-05-24 15:10:08 +0200 | [diff] [blame] | 15 | ], |
| 16 | ) |
| 17 | |
| 18 | go_binary( |
| 19 | name = "identd", |
Serge Bazanski | 97b5cd7 | 2023-07-28 17:14:50 +0000 | [diff] [blame^] | 20 | embed = [":identd_lib"], |
Serge Bazanski | 044386d | 2021-05-24 15:10:08 +0200 | [diff] [blame] | 21 | visibility = ["//visibility:public"], |
| 22 | ) |
| 23 | |
| 24 | container_layer( |
| 25 | name = "layer_bin", |
Serge Bazanski | 97b5cd7 | 2023-07-28 17:14:50 +0000 | [diff] [blame^] | 26 | directory = "/cluster/identd/", |
Serge Bazanski | 044386d | 2021-05-24 15:10:08 +0200 | [diff] [blame] | 27 | files = [ |
| 28 | ":identd", |
| 29 | ], |
Serge Bazanski | 044386d | 2021-05-24 15:10:08 +0200 | [diff] [blame] | 30 | ) |
| 31 | |
| 32 | container_image( |
| 33 | name = "runtime", |
| 34 | base = "@prodimage-bionic//image", |
Serge Bazanski | 97b5cd7 | 2023-07-28 17:14:50 +0000 | [diff] [blame^] | 35 | entrypoint = "/cluster/identd/identd", |
Serge Bazanski | 044386d | 2021-05-24 15:10:08 +0200 | [diff] [blame] | 36 | layers = [ |
| 37 | ":layer_bin", |
| 38 | ], |
Serge Bazanski | 044386d | 2021-05-24 15:10:08 +0200 | [diff] [blame] | 39 | ) |
| 40 | |
| 41 | container_push( |
| 42 | name = "push", |
Serge Bazanski | 044386d | 2021-05-24 15:10:08 +0200 | [diff] [blame] | 43 | format = "Docker", |
Serge Bazanski | 97b5cd7 | 2023-07-28 17:14:50 +0000 | [diff] [blame^] | 44 | image = ":runtime", |
Serge Bazanski | 044386d | 2021-05-24 15:10:08 +0200 | [diff] [blame] | 45 | registry = "registry.k0.hswaw.net", |
| 46 | repository = "q3k/identd", |
| 47 | tag = "{BUILD_TIMESTAMP}-{STABLE_GIT_COMMIT}", |
| 48 | ) |