4
0
Fork 2
mirror of https://gerrit.hackerspace.pl/hscloud synced 2025-01-20 16:53:54 +00:00
hscloud/cluster/identd/BUILD.bazel
radex a0eed97030 *: migrate to rules_oci, fix cross-compilation
Change-Id: I29742930ec0053aa41e2bcac915f8e2678e9095d
Reviewed-on: https://gerrit.hackerspace.pl/c/hscloud/+/2097
Reviewed-by: q3k <q3k@hackerspace.pl>
2025-01-11 21:31:45 +00:00

54 lines
1.3 KiB
Python

load("@aspect_bazel_lib//lib:transitions.bzl", "platform_transition_binary")
load("@rules_go//go:def.bzl", "go_binary", "go_library")
load("@rules_oci//oci:defs.bzl", "oci_image", "oci_push")
load("@rules_pkg//pkg:tar.bzl", "pkg_tar")
go_library(
name = "identd_lib",
srcs = ["main.go"],
importpath = "code.hackerspace.pl/hscloud/cluster/identd",
visibility = ["//visibility:private"],
deps = [
"//cluster/identd/ident",
"//cluster/identd/kubenat",
"//go/mirko",
"@com_github_golang_glog//:glog",
"@io_k8s_apimachinery//pkg/apis/meta/v1:meta",
],
)
go_binary(
name = "identd",
embed = [":identd_lib"],
visibility = ["//visibility:public"],
)
platform_transition_binary(
name = "identd_x86",
binary = ":identd",
target_platform = "@rules_go//go/toolchain:linux_amd64",
)
pkg_tar(
name = "layer_bin",
srcs = [
":identd_x86",
],
package_dir = "/cluster/identd/",
)
oci_image(
name = "runtime",
base = "@prodimage-bionic-oci",
entrypoint = ["/cluster/identd/identd"],
tars = [
":layer_bin",
],
)
oci_push(
name = "push",
image = ":runtime",
remote_tags = ["1680303245"],
repository = "registry.k0.hswaw.net/radex/identd",
)