...
1load("@container_structure_test//:defs.bzl", "container_structure_test")
2load("@io_bazel_rules_go//go:def.bzl", "go_cross_binary")
3load("@rules_apko//apko:defs.bzl", "apko_image")
4load("@rules_oci//oci:defs.bzl", "oci_image", "oci_load")
5load("//hack/build/rules/container:index.bzl", "container_push", "go_oci_image")
6
7package(
8 default_visibility = ["//visibility:public"],
9)
10
11go_cross_binary(
12 name = "godoc",
13 platform = "@io_bazel_rules_go//go/toolchain:linux_amd64",
14 target = "@org_golang_x_tools//cmd/godoc",
15)
16
17apko_image(
18 name = "godoc_base",
19 config = "apko.yaml",
20 contents = "@godoc_lock//:contents",
21 tag = "godoc_base:latest",
22 tags = ["requires-network"],
23)
24
25oci_image(
26 name = "godoc_image",
27 base = "godoc_base",
28 env = {
29 "PATH": "/usr/local/go/bin:$PATH",
30 },
31 tags = ["manual"],
32 tars = [
33 "//hack/containers/layers:go_tar",
34 ],
35)
36
37go_oci_image(
38 name = "container",
39 base = ":godoc_image",
40 binary = "godoc",
41 tags = ["manual"],
42)
43
44oci_load(
45 name = "godoc_image_load",
46 image = ":container",
47 repo_tags = ["godoc_image:latest"],
48 tags = ["manual"],
49)
50
51container_structure_test(
52 name = "test",
53 configs = [
54 "godoc.yaml",
55 "//hack/containers/layers:go-test.yaml",
56 ],
57 driver = "docker",
58 image = ":container",
59 tags = ["manual"],
60)
61
62container_push(
63 image = ":container",
64 image_name = "godoc",
65 repository_file = "//hack/build/rules/container:workloads-repo",
66 tag = "latest",
67 tags = ["manual"],
68)
View as plain text