1load("@container_structure_test//:defs.bzl", "container_structure_test")
2load("@rules_apko//apko:defs.bzl", "apko_image")
3load("@rules_oci//oci:defs.bzl", "oci_image", "oci_load")
4load("@rules_pkg//:pkg.bzl", "pkg_tar")
5load("//hack/build/rules/container:index.bzl", "container_push")
6
7apko_image(
8 name = "virtctl_base",
9 config = "apko.yaml",
10 contents = "@virtctl_lock//:contents",
11 tag = "virtctl_base:latest",
12 tags = ["requires-network"],
13)
14
15pkg_tar(
16 name = "virtctl_tar",
17 files = {
18 "@virtctl_amd//file:file": "/usr/bin/virtctl",
19 },
20 mode = "755",
21 tags = [
22 "manual",
23 "no-remote-cache",
24 ],
25)
26
27oci_image(
28 name = "virtctl-image",
29 base = "virtctl_base",
30 entrypoint = [
31 "/bin/sh",
32 "-c",
33 "tail -f /dev/null",
34 ],
35 tags = [
36 "manual",
37 "no-remote-cache",
38 ],
39 tars = [
40 ":virtctl_tar",
41 ],
42 visibility = ["//visibility:public"],
43)
44
45oci_load(
46 name = "virtctl-image-load",
47 image = "virtctl-image",
48 repo_tags = ["virtctl-image:latest"],
49 tags = ["manual"],
50)
51
52filegroup(
53 name = "virtctl-image.tar",
54 srcs = [":virtctl-image-load"],
55 output_group = "tarball",
56)
57
58container_structure_test(
59 name = "virtctl-image-test",
60 configs = [
61 ":virtctl-container-test.yaml",
62 ],
63 driver = "tar",
64 image = ":virtctl-image.tar",
65 tags = ["manual"],
66)
67
68container_push(
69 image = ":virtctl-image",
70 image_name = "virtctl_oci",
71 repository_file = "//hack/build/rules/container:workloads-repo",
72 tags = ["manual"],
73)
View as plain text