load("@container_structure_test//:defs.bzl", "container_structure_test") load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") load("@rules_oci//oci:defs.bzl", "oci_image", "oci_load") load("@rules_pkg//:pkg.bzl", "pkg_tar") load("//hack/build/rules/container:index.bzl", "container_push") go_library( name = "apko-updater-bot_lib", srcs = ["main.go"], importpath = "edge-infra.dev/hack/tools/apko-updater-bot", visibility = ["//visibility:private"], deps = ["//hack/tools/apko-updater-bot/cmd"], ) go_binary( name = "apko-updater-bot", embed = [":apko-updater-bot_lib"], visibility = ["//visibility:public"], ) go_binary( name = "apko-updater-bot-linux", embed = [":apko-updater-bot_lib"], goarch = "amd64", goos = "linux", visibility = ["//visibility:public"], ) pkg_tar( name = "base_pkgs", srcs = [ "@apko_linux_amd64//:file", ], extension = "tgz", files = { ":apko-updater-bot-linux": "apko-updater-bot", }, mode = "755", package_dir = "/usr/local/bin", ) oci_image( name = "apko-updater-bot-base", base = "@distroless_base", tars = [ ":base_pkgs", ], ) oci_load( name = "apko-updater-bot-load", image = ":apko-updater-bot-base", repo_tags = ["apko-updater-bot:latest"], ) filegroup( name = "apko-updater-bot.tar", srcs = [":apko-updater-bot-load"], output_group = "tarball", ) container_structure_test( name = "test", configs = [ ":test.yaml", ], driver = "tar", image = ":apko-updater-bot.tar", tags = ["manual"], ) container_push( name = "container_push", image = ":apko-updater-bot-base", image_name = "apko-updater", repository_file = "//hack/build/rules/container:workloads-repo", tags = ["requires-network"], )